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: 143
Default Getting values from a variable sized range into an array

I need to get the values from a range of cells into an array. The range will
always start in the same cell on the sheet where it resides and it will
always be 3 cells wide. But it can grow in length.

Right now I get the values into the array with this statement:

Dim ReplaceArray As Variant

ReplaceArray = Worksheets(2).Range("a5:c6")

and that works fine as long as the range of cells containing the data is
static. Right now that works ok since I can manually change things as
needed, but I'd like to automate this and give the users the ability to add
to that list.

If I need to, I can increment a cell value on worksheet 2 that would be the
number of rows in the range, but I don't even know how to refer to the range
that way. and, there must be a better, more dynamic (and elegant) way to do
this. There is nothing on worksheet 2 below or to the right of the last cell
in the range, i.e. "C6" in the example above.

Thanks for any help on this.

Ken Loomis



 
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
Using variable sized range in CountIf() [email protected][_2_] Excel Discussion (Misc queries) 1 October 24th 07 11:15 AM
Variable sized combo box Bruce[_7_] Excel Programming 1 August 10th 04 09:28 AM
Calculating Average on variable sized datasets w/VBA nano Excel Programming 1 February 3rd 04 02:36 AM
Problem trying to us a range variable as an array variable TBA[_2_] Excel Programming 4 September 27th 03 02:56 PM
Summing a variable sized range programmatically Norma[_2_] Excel Programming 3 August 24th 03 07:31 PM


All times are GMT +1. The time now is 08:57 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"