View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.charting
Jon Peltier Jon Peltier is offline
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