LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Reading a Range to an 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.


My appologies, I grabbed the wrong variables, copy paste thing...

Dim vaSpreadShtName() As Variant
Dim vaPwd() As Variant
Dim vaWriteResPwd() As Variant

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

For iCounter = 1 To 5 Step 1
Debug.Print iCounter
Debug.Print vaSpreadShtName(iCounter)
Debug.Print vaPwd(iCounter)
Debug.Print vaWriteResPwd(iCounter)
Next iCounter

OR...
'using 5 based on the loop to load the array
Dim vaSpreadShtName(5) As Variant
Dim vaPwd(5) As Variant
Dim vaWriteResPwd(5) As Variant

For iCounter = 1 To 5 Step 1
Debug.Print iCounter
Debug.Print vaSpreadShtName(iCounter)
Debug.Print vaPwd(iCounter)
Debug.Print vaWriteResPwd(iCounter)
Next iCounter

HTH--Lonnie M.

 
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
Reading content of array formula Papa Jonah Excel Programming 0 November 29th 04 06:45 PM
Reading a VBA Array - Thanks SMS - John Howard Excel Programming 0 October 30th 04 11:35 PM
Reading .csv file into array mousetrap Excel Programming 1 November 26th 03 07:47 AM
reading an arbitrary selection into a 1D array Jamie Martin[_2_] Excel Programming 5 September 30th 03 05:25 PM
Reading a cell into an array Tick-Tock Excel Programming 2 September 11th 03 07:33 PM


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

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

About Us

"It's about Microsoft Excel"