View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default cell addresses selection for chart source

set rng = Range("A1:A5,A7:A11")

--
Regards,
Tom Ogilvy

wrote in message
ps.com...
I am trying to create a macro to select a range of cells from the same
row, but the columns may or may not be contiguous and the cell
references are not constant (they will change every month). Then use
this selection for the SetSourceData in a chart.

For example if I manually select the following using the CNTL key:
a1,a2,a3,a4,a5, a7,a8,a9,a10,a11 (as in a 2 weeks worth of data)
I would use this selection in the source for a chart.

Should I start the cell selection from Starting Point A and go through
a loop to select the necessary cells and place into an array? Or
should I use a set range command? I hope I am being clear. Any help
would be appreciated.

Thank you.

Leslie