Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 9
Default How do I change the X axis scale on all charts in a workbook?

I have multiple charts on a number of worksheets in one workbook and I need
to have the same X axis scale on all of them.

Thanks for any help
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default How do I change the X axis scale on all charts in a workbook?

Unless you're using Excel 2007 it's easy. Double click the X axis on one
chart, and do all your adjustments before clicking on OK. Then select the
next X axis and press the F4 function key (shortcut for Repeat Last Action).
Repeat as needed.

In Excel 2007 the F4 key no longer reliably repeats the last action.
Sometimes it does, but often I'm left repeating things the long way.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"hlmrspd" wrote in message
...
I have multiple charts on a number of worksheets in one workbook and I need
to have the same X axis scale on all of them.

Thanks for any help



  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 9
Default How do I change the X axis scale on all charts in a workbook?

That will work better than what I am currently doing.
But what I really want is to use some reference cells to set the min max and
divisions and then use a macro to update X axis.
I can do this for one or two charts easily but I can't figure out how to
apply it to all the charts in the workbook.
Note: I have ~ 50 charts and they change periodically.

hlmrspd

"Jon Peltier" wrote:

Unless you're using Excel 2007 it's easy. Double click the X axis on one
chart, and do all your adjustments before clicking on OK. Then select the
next X axis and press the F4 function key (shortcut for Repeat Last Action).
Repeat as needed.

In Excel 2007 the F4 key no longer reliably repeats the last action.
Sometimes it does, but often I'm left repeating things the long way.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"hlmrspd" wrote in message
...
I have multiple charts on a number of worksheets in one workbook and I need
to have the same X axis scale on all of them.

Thanks for any help




  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default How do I change the X axis scale on all charts in a workbook?

The generic protocol for linking axis limits to cells is described he

http://peltiertech.com/Excel/Charts/...nkToSheet.html

Instead of operating on a single chart, you would use (for embedded charts)

For Each Sht In ActiveWorkbook.Sheets
For Each ChtObj In Sht.ChartObjects
With ChtObj.Chart
' code from article above
End With
Next
Next

or (for chart sheets)

For Each Cht In ActiveWorkbook.Charts
With Cht
' code from article above
End With
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"hlmrspd" wrote in message
...
That will work better than what I am currently doing.
But what I really want is to use some reference cells to set the min max
and
divisions and then use a macro to update X axis.
I can do this for one or two charts easily but I can't figure out how to
apply it to all the charts in the workbook.
Note: I have ~ 50 charts and they change periodically.

hlmrspd

"Jon Peltier" wrote:

Unless you're using Excel 2007 it's easy. Double click the X axis on one
chart, and do all your adjustments before clicking on OK. Then select the
next X axis and press the F4 function key (shortcut for Repeat Last
Action).
Repeat as needed.

In Excel 2007 the F4 key no longer reliably repeats the last action.
Sometimes it does, but often I'm left repeating things the long way.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"hlmrspd" wrote in message
...
I have multiple charts on a number of worksheets in one workbook and I
need
to have the same X axis scale on all of them.

Thanks for any help






  #5   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 9
Default How do I change the X axis scale on all charts in a workbook?

That work great, I added a macro to return the X axis to auto as well.
This sure made my work easier. Thanks!!!
Here are the Macros:

Sub ChangeXAxisScale()

'
' Change the X axis on all charts based on cell input
'

For Each Sht In ActiveWorkbook.Sheets
For Each ChtObj In Sht.ChartObjects
With ChtObj.Chart
' Category (X) Axis
With .Axes(xlCategory)
.MaximumScale = ActiveSheet.Range("'PCS Pwr,T'!$A$14").Value
.MinimumScale = ActiveSheet.Range("'PCS Pwr,T'!$A$16").Value
.MajorUnit = ActiveSheet.Range("'PCS Pwr,T'!$A$18").Value
End With

End With
Next
Next
End Sub


Sub returnXaxistoauto()
'
' returntoauto Macro returns the X axis scale to auto
'

'
For Each Sht In ActiveWorkbook.Sheets
For Each ChtObj In Sht.ChartObjects
With ChtObj.Chart
' Category (X) Axis
With .Axes(xlCategory)
.MinimumScaleIsAuto = True
.MaximumScaleIsAuto = True
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
End With
End With
Next
Next
End Sub




"Jon Peltier" wrote:

The generic protocol for linking axis limits to cells is described he

http://peltiertech.com/Excel/Charts/...nkToSheet.html

Instead of operating on a single chart, you would use (for embedded charts)

For Each Sht In ActiveWorkbook.Sheets
For Each ChtObj In Sht.ChartObjects
With ChtObj.Chart
' code from article above
End With
Next
Next

or (for chart sheets)

For Each Cht In ActiveWorkbook.Charts
With Cht
' code from article above
End With
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"hlmrspd" wrote in message
...
That will work better than what I am currently doing.
But what I really want is to use some reference cells to set the min max
and
divisions and then use a macro to update X axis.
I can do this for one or two charts easily but I can't figure out how to
apply it to all the charts in the workbook.
Note: I have ~ 50 charts and they change periodically.

hlmrspd

"Jon Peltier" wrote:

Unless you're using Excel 2007 it's easy. Double click the X axis on one
chart, and do all your adjustments before clicking on OK. Then select the
next X axis and press the F4 function key (shortcut for Repeat Last
Action).
Repeat as needed.

In Excel 2007 the F4 key no longer reliably repeats the last action.
Sometimes it does, but often I'm left repeating things the long way.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"hlmrspd" wrote in message
...
I have multiple charts on a number of worksheets in one workbook and I
need
to have the same X axis scale on all of them.

Thanks for any help








  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 38
Default How do I change the X axis scale on all charts in a workbook?

Jon,
Could you tell me how I could make something like this work for multiple
(50+) Chart Sheets with a different x-axis (min,max) and a Source Data Series
(X) Range.

I have a worksheet with 'col A' = ChartSht Name; 'col B' = X-Min; 'col C' =
Y-Max; 'col D' = m & 'col E' = n for Series ={m,n}
A B C D E
Sec1 (1) 0 1000 0 1000
Sec1 (2) 1000 2000 1000 2000
Sec1 (3) 2000 3000 2000 3000

I would like all the charts to update with this data when I run a macro

"Jon Peltier" wrote:

The generic protocol for linking axis limits to cells is described he

http://peltiertech.com/Excel/Charts/...nkToSheet.html

Instead of operating on a single chart, you would use (for embedded charts)

For Each Sht In ActiveWorkbook.Sheets
For Each ChtObj In Sht.ChartObjects
With ChtObj.Chart
' code from article above
End With
Next
Next

or (for chart sheets)

For Each Cht In ActiveWorkbook.Charts
With Cht
' code from article above
End With
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"hlmrspd" wrote in message
...
That will work better than what I am currently doing.
But what I really want is to use some reference cells to set the min max
and
divisions and then use a macro to update X axis.
I can do this for one or two charts easily but I can't figure out how to
apply it to all the charts in the workbook.
Note: I have ~ 50 charts and they change periodically.

hlmrspd

"Jon Peltier" wrote:

Unless you're using Excel 2007 it's easy. Double click the X axis on one
chart, and do all your adjustments before clicking on OK. Then select the
next X axis and press the F4 function key (shortcut for Repeat Last
Action).
Repeat as needed.

In Excel 2007 the F4 key no longer reliably repeats the last action.
Sometimes it does, but often I'm left repeating things the long way.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"hlmrspd" wrote in message
...
I have multiple charts on a number of worksheets in one workbook and I
need
to have the same X axis scale on all of them.

Thanks for any help






  #7   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1
Default How do I change the X axis scale on all charts in a workbook?

This only affects the chart object within the active sheet, for me. How would I modify it to work with all charts in the workbook? I have 60+ charts I would like to update...

I am currently trying to use:

---
Sub FormatYAxis()
For Each Sht In ActiveWorkbook.Sheets
For Each ChtObj In Sht.ChartObjects
With ChtObj.Chart

' Category (Y) Axis
With .Axes(xlValue)
.MinimumScale = Range("B11").Value
.MaximumScale = Range("B12").Value
.MinorUnit = Range("B13").Value
.MajorUnit = Range("B14").Value
End With
End With
Next
Next
End Sub
Reply
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 09:03 AM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
"Scale breaks" required in (Z) axis FH1 Charts and Charting in Excel 3 June 4th 05 06:09 AM
Excel Charts - Data being Plotted beyond Primary X-Axis Scale Yvonne Fochesato Charts and Charting in Excel 1 May 1st 05 03:36 AM
change axis info on radar charts alfred Charts and Charting in Excel 1 January 11th 05 05:36 AM


All times are GMT +1. The time now is 12:23 PM.

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

About Us

"It's about Microsoft Excel"