Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Macro to determine min/max values of column

I need a macro to set min & max values for a chart. The macro should
search a data column to determine the min & max values. I can handle
setting the chart but am a little vague one determining the min & max
values. Excel97



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Macro to determine min/max values of column

maxValue = Application.Max(rng)

the other is obvious

--
__________________________________
HTH

Bob

"Fan924" wrote in message
...
I need a macro to set min & max values for a chart. The macro should
search a data column to determine the min & max values. I can handle
setting the chart but am a little vague one determining the min & max
values. Excel97





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Macro to determine min/max values of column

With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue)
.MinimumScale = Range("F7")
.MaximumScale = WorksheetFunction.Max(Range("E10:E1000"))
End With


here, F7 is a cell with the MIN() function. I like this because you can also
show max and/or min specifically on the chart if the values are on the sheet

"Fan924" wrote:

I need a macro to set min & max values for a chart. The macro should
search a data column to determine the min & max values. I can handle
setting the chart but am a little vague one determining the min & max
values. Excel97




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Macro to determine min/max values of column

Thanks guys. I was really stuck.I made some small changes to Patrick's
code:

Sub TestChart1()
With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue)
.MinimumScale = WorksheetFunction.Min(Range("B3:B17"))
.MaximumScale = WorksheetFunction.Max(Range("B3:B17"))
End With
End Sub

Instead of using Range("B3:B17"), I would like to read the current Y-
axis range and use that instead. Any ideas.
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
Determine a result of one column based on conditions in two column tel703 Excel Discussion (Misc queries) 1 March 25th 10 05:01 PM
Macro to determine values [email protected] Excel Programming 1 June 9th 09 05:53 AM
using cells values to determine macro action simonsmith[_2_] Excel Programming 2 May 16th 06 08:03 PM
macro to transpose cells in Column B based on unique values in Column A Aaron J. Excel Programming 3 October 8th 04 02:29 PM
Determine start column/ end column of Merged Cell jC! Excel Programming 3 July 8th 04 12:05 PM


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