Dynamic Range

  • Thread starter Thread starter Tony Reflinski
  • Start date Start date
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
 
Hi Tony,

Try:

Dim rng As Range

Set rng = ActiveCell.Resize(1, 6)

ActiveChart.SetSourceData Source:=rng, PlotBy:=xlRows
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top