View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Setting chart data range automatically

No, you needed to change

Source:=Sheets("ChartData").Range(ChartRange),

to
Source:=ChartRange.Address


Source:=Sheets("ChartData").Range(ChartRange.Addre ss)

would work as well.


I also gave you that correction. Subscript out of range would indicate that
you don't have the proper name for your sheet.

--
Regards,
Tom Ogilvy



"LoucaGreen " wrote in message
...
Hi,

Thanks for your reply.

Now I get another error

"Run-time error '9'
Subscript out of range"

Nevermind though. The solution was given to me at the Charting forum.

I had to change the
Source:=Sheets("ChartData").Range(ChartRange.Addre ss)
to Source:=ChartRange.Address.

Thanks

LoucaGreen


---
Message posted from http://www.ExcelForum.com/