M
Madiya
I am trying to use a arrey variable as I am not sure of the no of strings I will get back.
Here is my code sample.
Sub Macro1()
Dim p() As Integer
For i = 1 To 10
p(i) = i * 10 '<<<<<< ERROR LINE
Next
For i = 1 To 10
Debug.Print p(i)
Next
End Sub
I am getting subscript out of range error on line marked above.
However if I use Dim p(100) as integer, I do not get error.
As far as possible, I would like to use arrey without specifying any upper limit.
Pl help.
Regards,
Madiya
Here is my code sample.
Sub Macro1()
Dim p() As Integer
For i = 1 To 10
p(i) = i * 10 '<<<<<< ERROR LINE
Next
For i = 1 To 10
Debug.Print p(i)
Next
End Sub
I am getting subscript out of range error on line marked above.
However if I use Dim p(100) as integer, I do not get error.
As far as possible, I would like to use arrey without specifying any upper limit.
Pl help.
Regards,
Madiya