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: 125
Default change max scale in chart

Hi

I am tring to get a macro to change the maximum scale value in a chart, based
on a cell in the data sheet. In this case G5 in data "sheet1". In cell G5 ,
I have the max formulaI have named the chart "test". I have pasted the code
in a module, and if, with help, it works, will paste the second code in "This
workbook". As you no doubt guessed, I am not too familar with VBA, and have
managed to get hold of this code, however, it is failing.

Help appriciated

Regards


Sub UpdateScale()
ActiveSheet.ChartObjects("test").Activate
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = Range("G5").Value
End With
End Sub



Private Sub Worksheet_Change(ByVal Target As Range)
mySelection = ActiveWindow.RangeSelection.Address
UpdateScale
Range(mySelection).Select
End Sub

--
Message posted via http://www.officekb.com

 
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 change the legend scale of surface chart in XL2007 ramki Charts and Charting in Excel 3 May 7th 23 11:43 AM
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
Can't change the scale of values on a y-axis on a line chart ags Charts and Charting in Excel 1 August 8th 06 12:35 AM
how can I change the scale of the numbers in my chart data table? LauraLandmark Charts and Charting in Excel 1 August 22nd 05 02:46 PM
How to change maximum scale of a logarithmic chart on an EXCELL ch Mohammad Shahsavarifard Charts and Charting in Excel 1 August 22nd 05 01:51 PM


All times are GMT +1. The time now is 10:09 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"