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 > create array from range of cells

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-07-09, 11:14
mikezx10 mikezx10 is offline
Registered User
 
Join Date: Oct 2003
Posts: 226
create array from range of cells

My code currently has this line:

Sheets(Array("BA", "CA", "Co", "To", "Ex", "GW","AL")).Select

if the name of a sheet changes it breaks my code.

I dont want to select all the sheets, so i added a method that writes only the current name of sheets i want to select to a range on a spread sheet, so
A1="BA"
A2="CA"
etc...

how do i read those values to an array given that i selected the range of values already (range("TheNames").select ) ?
Reply With Quote
  #2 (permalink)  
Old 07-07-09, 14:56
ganeshdlegend ganeshdlegend is offline
Registered User
 
Join Date: Feb 2009
Posts: 24
mike,

i don't fully understand your problem. see if this solves it...

if you want to use the data in cells as array (i.e) data in the cell "A1",

the code line is...
Sheets("sheet1").range("A1").value

now, since you have already selected the range, try using
(range("TheNames").value) instead of (range("TheNames").select).
__________________
Ganesh
Everyone is gifted! Some open the package sooner!
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