ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Easy question? (https://www.excelbanter.com/excel-programming/327624-easy-question.html)

Marc[_21_]

Easy question?
 
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).Mi nimumScale = 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).Mi nimumScale = 0

If someone can help.

Thanks in advance



Don Guillett[_4_]

Easy question?
 
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

--
Don Guillett
SalesAid Software

"Marc" wrote in message
...
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).Mi nimumScale = 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).Mi nimumScale = 0

If someone can help.

Thanks in advance





Don Guillett[_4_]

Easy question?
 
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

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
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

--
Don Guillett
SalesAid Software

"Marc" wrote in message
...
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).Mi nimumScale = 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).Mi nimumScale = 0

If someone can help.

Thanks in advance








All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com