LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 239
Default Arrey VAriable - How to initialise

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Arrey Formula Eva Excel Worksheet Functions 2 February 15th 10 05:59 PM
How to avoid arrey formula? Madiya Excel Programming 5 September 17th 08 09:00 AM
Active x Initialise prompt Corey Excel Programming 1 July 23rd 07 05:19 AM
Userform initialise not executing. kirkm[_6_] Excel Programming 4 March 17th 07 01:41 AM
initialise declaration Joe[_46_] Excel Programming 13 September 13th 06 11:01 PM


All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"