View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Kevin H. Stecyk[_2_] Kevin H. Stecyk[_2_] is offline
external usenet poster
 
Posts: 43
Default Reading a Range to an Array

Lonnie M. wrote...
Keven, try one of the two examples, be sure to at least use parenthese
when declaring the array:

Dim sSpreadShtNameRng() As String '\Range Name1
Dim sPwdNameRng() As String '\Range Name2
Dim sWriteResPwdNameRng() As String '\Range Name3


No, I don't think I should not be putting() because these are simply
strings. They are not an array It is a string, which is the name of the
range on Hidden spreadsheet which contains 5 values per range.

ReDim Preserve vaSpreadShtName(1 To 5) 'for dynamic (1 To
VarriableHere)
ReDim Preserve vaPwd (1 To 5)
ReDim Preserve vaWriteResPwd(1 To 5)


I tried this but I got the same error message.

Run-time error 9, subscript out of range. I wished it worked. Then my
problem would be solved.


OR...

Dim sSpreadShtNameRng(5) As String '\Range Name1
Dim sPwdNameRng(5) As String '\Range Name2
Dim sWriteResPwdNameRng(5) As String '\Range Name3


There is only one sSpreadshtNameRng, which is xrnSpreadShtNameCC. There are
not five of them. So I don't think this is my trouble spot here in that I
need to create an array.

I must be doing something that is wrong, but I am not sure what it is.

Thank you for trying.

Regards,
Kevin