If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Read Range values to array

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-22-09, 08:37
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
Read Range values to array

is there a better way to do this, like select all the rows in the column and then from there add the items in toArray function or something?

Dim i As Integer
Dim printSheetsCodeNames() As String
Dim wks As Worksheet

Range("B2").Select 'CodeName Column

i = 0
While ActiveCell.Value <> vbNullString
ReDim Preserve printSheetsCodeNames(i)
printSheetsCodeNames(i) = ActiveCell.Value
ActiveCell.Offset(1, 0).Select
i = i + 1
Wend
Reply With Quote
  #2 (permalink)  
Old 07-22-09, 09:17
Ax238 Ax238 is offline
Registered User
 
Join Date: May 2009
Posts: 257
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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