Set Source Data for Chart on different sheet

NatetheGreat

Active Member
Joined
Nov 18, 2013
Messages
268
Hi there,

I am very new to VBA. I have written the following code

Sub Series1()
Sheets("Charts").Activate
ActiveSheet.ChartObjects("Chart 3").Activate
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData Source:=Sheets("Raw Data").Range("Y16:Y266")
End Sub

When I had the chart on the raw data sheet, and they were both therefore on the active sheet, it was working fine. I had to move the chart to a different sheet, but am failing to get the Set Source Data Syntax correct to get it to look on the Raw Data sheet for the Chart Series Range.

PLEEAASEEE CAN SOMEONE HELP ! Driving me crazy !!!!
 

Forum statistics

Threads
1,082,478
Messages
5,365,789
Members
400,850
Latest member
Raj_Jpr

Some videos you may like

This Week's Hot Topics

Top