Referencing sheets/objects

  • Thread starter Thread starter dve11
  • Start date Start date
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("C16:D82"), PlotBy _
:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="CSheet"
etc..
 

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

Similar Threads

Project Two - Sheet Number 3
Delete a chart 4
Excel Macro for Charts 1
Chart Size & Position 3
Charts in VBA 1
Excel Macro Help for Charts 8
Loop to create charts 1
Dynamic chart problem 1

Back
Top