invalid or unqualified reference error

shodan

Active Member
Joined
Jul 6, 2005
Messages
486
Hi board,

Can someone tell me why I get following error on this code:

Invalid or unqualified reference when I run following code:

Code:
Sub changeaxisscale()

Worksheets("Charts_YTD").ChartObjects("Chart 1").Chart.Axes(xlValue) _
     .MinimumScale = Worksheets("Base").Range("G2").Value
Worksheets("Charts_YTD").ChartObjects("Chart 1").Chart.Axes(xlValue) _
     .MaximumScale = Worksheets("Base").Range("G3").Value


Worksheets("Charts_YTD").ChartObjects("Chart plant").Chart.Axes (xlValue)
     .MinimumScale = Worksheets("Base").Range("P2").Value
Worksheets("Charts_YTD").ChartObjects("Chart plant").Chart.Axes(xlValue) _
     .MaximumScale = Worksheets("Base").Range("P3").Value

End Sub


It happens when it comes to minumscale. Strange thing is that this has always worked before. According to me I only changed worksheet names.

Thanks al lot !!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
What I see is on this line...
Code:
Worksheets("Charts_YTD").ChartObjects("Chart plant").Chart.Axes (xlValue)
     .MinimumScale = Worksheets("Base").Range("P2").Value

Change to
Code:
Worksheets("Charts_YTD").ChartObjects("Chart plant").Chart.Axes(xlValue) [COLOR="Red"]_[/COLOR]    
     .MinimumScale = Worksheets("Base").Range("P2").Value
 
Upvote 0

Forum statistics

Threads
1,224,547
Messages
6,179,436
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top