Easy question?

  • Thread starter Thread starter Marc
  • Start date Start date
M

Marc

I have this code with button on click event and it doesn't work.

Worksheets("Data").Range("A4:C4").Copy
ActiveSheet.Paste Destination:=Worksheets("Graph").Range("A2:C2")
Worksheets(8).Activate

ActiveSheet.ChartObjects(1).Chart.Axes(xlValue).MinimumScale = 0
Application.CutCopyMode = False

This is only chart in workbook.

Error is in line (highlights this line when running code)
ActiveSheet.ChartObjects(1).Chart.Axes(xlValue).MinimumScale = 0

If someone can help.

Thanks in advance
 
There should be no error in that line. Perhaps it is NOT the active sheet?
Is sheet(8) also Graph? The sheet does NOT have to be active.

Worksheets("Data").Range("A4:C4"). _
Copy Worksheets("Graph").Range("A2:C2")
Worksheets(8).ChartObjects(1). _
Chart.Axes(claque).MinimumScale = 0
 
ALSO
In case your graph is on a separate graph sheet instead of imbedded, change
WORKsheets to just Sheets and for the sheet number sheet8
 

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

Back
Top