Dynamic Range

T

Tony Reflinski

In the following: ActiveChart.SetSourceData Source:=Sheets
("Sheet1").Range("E21:K21"), PlotBy _
:=xlRows
instead of Range("E21:K21")above,I want to assign range
based on currently selected cell as the begining of range
and nest 6 cell in the same row.

Please help
 
N

Norman Jones

Hi Tony,

Try:

Dim rng As Range

Set rng = ActiveCell.Resize(1, 6)

ActiveChart.SetSourceData Source:=rng, PlotBy:=xlRows
 
N

Norman Jones

Hi Tony,

Re-reading, you want a seven cell range, so replace

Set rng = ActiveCell.Resize(1, 6)

with

Set rng = ActiveCell.Resize(1, 7)
 
Top