dyanmic range

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I am trying to plot a graph in VBA using a selected range.
However I only want the range to incorporate column A and D, which will
expand over time.

How Can I express the following so that the range updates dynamically when
new rows are entered?
Range("A1:A23,D1:D23").Select

Tried this, but does not work at all:
Range(Range("A1").End(xlDown), Range("D1").End(xlDown)).Select

Thank you.
 
Steve,

This should work:

range(range("A1"), range("A1").End(xlDown).Resize(,4)).Select

John
 
Steve,

Just for clarification.....
My example will give select the range based on the last cell in
column "A" (looking downward) while mudrakers will select you
the range based on the last cell in Column "D" (looking downward).

Having looked at the posts, the following is yet another way:
(There are plenty of other ways to do this, I'm sure.)

range("A1").currentregion.Resize(,4).Select

The above uses A1 as a starting point and selects the entire
contiguous range of cells and then just resizes the columns
to 4.

John
 
Back
Top