Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Setting the minimum/maximum display range of a chart

I thought I posted this question yesterday, but can't find it today so I'll
repost and hope for the best.

Basically I'm using a stacked bar chart as a GANTT schedule, and want to
ensure that the minimum and maximum display ranges are set to something
relevant... What I want to do then is, ideally, to enter =TODAY()-30 (for
example) as the minimum range and =TODAY()+30 as the maximum, but obviously
this doesn't work in a straightforward way... does anybody know of a
workaround for this, so that I can set the minimum range as an equation, or a
reference?

All suggestions are appreciated - thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 857
Default Setting the minimum/maximum display range of a chart

Hi,

You need to use code, here is a sample you will need to modify for you
situation:

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = Date - 30
.MaximumScale = Date + 30
End With


--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Babymech" wrote:

I thought I posted this question yesterday, but can't find it today so I'll
repost and hope for the best.

Basically I'm using a stacked bar chart as a GANTT schedule, and want to
ensure that the minimum and maximum display ranges are set to something
relevant... What I want to do then is, ideally, to enter =TODAY()-30 (for
example) as the minimum range and =TODAY()+30 as the maximum, but obviously
this doesn't work in a straightforward way... does anybody know of a
workaround for this, so that I can set the minimum range as an equation, or a
reference?

All suggestions are appreciated - thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Setting the minimum/maximum display range of a chart

Hi Shane,

Thanks - that opened up a lot of possibilities for me, since I haven't
thought of doing anything with VBA to help the chart, but how do you
recommend I use the code? All I've done so far with VBA has been to make
buttons, and I wanted to avoid buttons in this sheet because I know the
person filling it in will never manage to figure out when he should or
shouldn't be pressing buttons, or enabling macros, etc. I guess I'll have to
accept that the sheet will be macro-enabled, and try to teach him to enable
macros when it asks him to, but is there some way I can make the code that
adjusts the chart range run automatically? Say, either when he opens the
sheet or when he enters a new task (ie when for example a new cell in column
D goes from empty to actually containing something)?

Thanks for your help so far!

"Shane Devenshire" wrote:

Hi,

You need to use code, here is a sample you will need to modify for you
situation:

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = Date - 30
.MaximumScale = Date + 30
End With


--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Babymech" wrote:

I thought I posted this question yesterday, but can't find it today so I'll
repost and hope for the best.

Basically I'm using a stacked bar chart as a GANTT schedule, and want to
ensure that the minimum and maximum display ranges are set to something
relevant... What I want to do then is, ideally, to enter =TODAY()-30 (for
example) as the minimum range and =TODAY()+30 as the maximum, but obviously
this doesn't work in a straightforward way... does anybody know of a
workaround for this, so that I can set the minimum range as an equation, or a
reference?

All suggestions are appreciated - thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Setting the minimum/maximum display range of a chart

Never mind - I think I found it. Thanks!

"Babymech" wrote:

Hi Shane,

Thanks - that opened up a lot of possibilities for me, since I haven't
thought of doing anything with VBA to help the chart, but how do you
recommend I use the code? All I've done so far with VBA has been to make
buttons, and I wanted to avoid buttons in this sheet because I know the
person filling it in will never manage to figure out when he should or
shouldn't be pressing buttons, or enabling macros, etc. I guess I'll have to
accept that the sheet will be macro-enabled, and try to teach him to enable
macros when it asks him to, but is there some way I can make the code that
adjusts the chart range run automatically? Say, either when he opens the
sheet or when he enters a new task (ie when for example a new cell in column
D goes from empty to actually containing something)?

Thanks for your help so far!

"Shane Devenshire" wrote:

Hi,

You need to use code, here is a sample you will need to modify for you
situation:

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = Date - 30
.MaximumScale = Date + 30
End With


--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Babymech" wrote:

I thought I posted this question yesterday, but can't find it today so I'll
repost and hope for the best.

Basically I'm using a stacked bar chart as a GANTT schedule, and want to
ensure that the minimum and maximum display ranges are set to something
relevant... What I want to do then is, ideally, to enter =TODAY()-30 (for
example) as the minimum range and =TODAY()+30 as the maximum, but obviously
this doesn't work in a straightforward way... does anybody know of a
workaround for this, so that I can set the minimum range as an equation, or a
reference?

All suggestions are appreciated - thanks!

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
finding maximum, minimum in a range consists both Positive and Negative numbers Praveen Excel Worksheet Functions 3 May 4th 23 07:45 PM
How cani draw maximum and minimum lines in a chart in excel? Alf Charts and Charting in Excel 1 March 31st 08 09:09 AM
bar chart axes minimum & maximum KRK Charts and Charting in Excel 1 March 21st 08 01:45 PM
Maximum and Minimum Lines linking a chart chelo Charts and Charting in Excel 1 April 16th 07 12:39 PM
Automatic formatting of minimum/maximum value in a range. Manish Kumar Excel Discussion (Misc queries) 2 March 5th 05 06:45 PM


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