LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Changing Chart Parameters


Is there a way to change chart parameters without actually selecting the
sheet or activating the chart?

I have about 160 individual charts on three worksheets.
I know I can set Application.ScreenUpdating = False as a last resort.

Here is the basic structure for updating one chart's parameters.

Sub SetAxesValues()
Dim cMin, cMax
cMax = Sheets("Electric").Range("A3").Value
cMin = Sheets("Electric").Range("A4").Value

Sheets("Electric").Select
ActiveSheet.ChartObjects("PotElectRoll").Activate

With ActiveChart.Axes(xlValue)
.MinimumScale = cMin
.MaximumScale = cMax
.MinorUnit = (cMax - cMin) / 25
.MajorUnit = (cMax - cMin) / 5
End With

cMin = Sheets("Electric").Range("A5").Value
cMax = Sheets("Electric").Range("A6").Value

With ActiveChart.Axes(xlCategory)
.MinimumScale = cMin
.MaximumScale = cMax
End With
End Sub


Can the two lines selecting the sheet and activating the chart be
replaced by
wrapping the rest of the routine in a With / End With construction?

I just can't seem to find the syntax... The following doesn't work.

With Sheets.ChartObjects("PotElectRoll")
...
End With


--
DCSwearingen

Getting old, but love computers.
------------------------------------------------------------------------
DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506
View this thread: http://www.excelforum.com/showthread...hreadid=568668

 
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
Chart select, yet changing set of series name Charts and Charting in Excel 5 July 8th 06 02:33 PM
Selecting part of a series for a chart? Al Charts and Charting in Excel 6 May 16th 06 12:45 PM
Changing Time Scale to Seconds on Excel Chart JaneinPA Charts and Charting in Excel 2 March 8th 06 09:29 PM
how can I limit my chart Richard Erlacher Charts and Charting in Excel 7 March 7th 06 12:08 PM
multiple or changing colours in a data table on an excel chart fo. Kerri Buxton Charts and Charting in Excel 2 December 23rd 04 07:39 PM


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