Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 80
Default Y Axis Auto updatem Max, Min and Scale

Hi.

I have a chart in a worksheet which changes according to selections made in
a user-form using combo-boxes. These combo boxes are from the forms toolbar
rather than the control toolbox.

I have derived the following code from the cited source and modified it as
noted. I have read Chip Pearsons notes on Events in Userform controls and
added the code €śFormEnableEvents = True€ť.

However it does not fully work until another activity updates the worksheet.
E.g. F2 and enter.

I could add a macro button with the instruction €śClick to update Chart€ť.
Can anyone indicate how I might amend the following code to make the update
happen automatically?

--------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'Base Code copied from
'http://peltiertech.com/Excel/Charts/AxisScaleLinkToSheet.html
' Category (X) Axis code removed as not required
' Chart name changed
' Cell References replaced by named ranges
'
'Need to ensure that events on userforms update the chart.
FormEnableEvents = True
'Identify the chart
With ActiveSheet.ChartObjects("Chart 5").Chart

' Set the characteristics for the Y Axis
With .Axes(xlValue)
.MajorUnit = ActiveSheet.Range("DScale").Value
.MinimumScale = ActiveSheet.Range("DMin").Value
.MaximumScale = ActiveSheet.Range("DMax").Value
End With

End With
End Sub
------------------

Further points.
1. The named ranges DScale, DMin, and D Max are updated by formulae.
2. The order of .MajorUnit, .MaximumScale, and .MinimumScale does not seem
to improve or impair performance.
3. The code is in the worksheet object code for the appropriate worksheet.
4. Workbook recalculation is set to automatic.

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 08:03 AM
Urgent - X and Y Axis Auto Scale for Chart Sandi Charts and Charting in Excel 3 June 9th 06 09:04 AM
Y Axis Auto Scale Arturo Charts and Charting in Excel 1 March 27th 06 04:23 PM
Auto Y-Axis Scale systemx Charts and Charting in Excel 1 March 22nd 06 06:47 AM
Chart Axis Scale Auto Values Moses Bunting Charts and Charting in Excel 1 June 7th 05 11:03 PM


All times are GMT +1. The time now is 07:00 AM.

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"