D
dve11
Hi,
I am new to writing macros for excel and have a problem I need some
help with:
I want to add a chart using data from the active sheet. I tried the
code below. I know it's writing the active sheet name to CSheet
because I can read it using msgbox so why won't the reference work??
CSheet = ActiveSheet.Name
Charts.Add
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SetSourceData
Source:=Sheets("CSheet").Range("C1682"), PlotBy _
:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="CSheet"
etc..
I am new to writing macros for excel and have a problem I need some
help with:
I want to add a chart using data from the active sheet. I tried the
code below. I know it's writing the active sheet name to CSheet
because I can read it using msgbox so why won't the reference work??
CSheet = ActiveSheet.Name
Charts.Add
ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
ActiveChart.SetSourceData
Source:=Sheets("CSheet").Range("C1682"), PlotBy _
:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="CSheet"
etc..