LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 9
Default Y axis scale macro

I have created a macro (with help from this forum) to automatically adjust
the Y axis based on the selected x axis data. The macro works but when the
macro runs it pages through all the excel sheets that I have the charts on.
Is there a change I can make to the macro so it will stay on the sheet that I
have the button on?

Here is the code for the macro:

For I = 3 To 63

sheetname = Range("'Yaxis'!$B$" & I).Value
Sheets(sheetname).Select

A = Range("'Yaxis'!$C$" & I).Value

With ActiveSheet.ChartObjects(A).Chart

With .Axes(xlValue)
.MaximumScale = Range("'Yaxis'!$D$" & I).Value
.MinimumScale = Range("'Yaxis'!$E$" & I).Value
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True

End With

End With

Next


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to draw chart: log scale on X axis, natural scale on y axis? Pratap D. chavan Charts and Charting in Excel 1 November 16th 06 08:03 AM
How do I reference x-axis or y-axis scale values to a worksheet ce retro5726 Excel Discussion (Misc queries) 0 August 10th 06 01:46 AM
How to make Primary axis and Secondary X-axis have the same scale AdamCPTD Excel Discussion (Misc queries) 0 July 14th 06 02:14 PM
Format Axis; Scale Tab; "Value Axis Crosses At" ends with preposit Pedant Charts and Charting in Excel 1 August 29th 05 03:50 AM
How to insert X axis scale values next to axis and X axis grid lin vp23larry Charts and Charting in Excel 2 June 23rd 05 03:45 PM


All times are GMT +1. The time now is 09:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"