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 chart name

I have multiple sheets and there is a single chart on each sheet. I
want to use this macro but not all charts are named Chart1. Is there a
way the macro can be made to work no matter what the chart name is?

Sub TestChart()
With ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue)
.MinimumScale = WorksheetFunction.Min(Range("B3:B17"))
.MaximumScale = WorksheetFunction.Max(Range("B3:B17"))
End With
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Macro to determine chart name

Why don't you just select the chart on each sheet and rename it, give them
all the same name.

--
__________________________________
HTH

Bob

"Fan924" wrote in message
...
I have multiple sheets and there is a single chart on each sheet. I
want to use this macro but not all charts are named Chart1. Is there a
way the macro can be made to work no matter what the chart name is?

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Macro to determine chart name

On Sep 30, 12:52*am, "Bob Phillips" wrote:
Why don't you just select the chart on each sheet and rename it, give them
all the same name.


I did think of that. I hane no idea how to rename a chart. How is it
done? Excel97
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Macro to determine chart name

On Sep 30, 6:14*am, Fan924 wrote:
On Sep 30, 12:52*am, "Bob Phillips" wrote:

Why don't you just select the chart on each sheet and rename it, give them
all the same name.


I did think of that. I hane no idea how to rename a chart. How is it
done? Excel97


I found this and it tells me how to do it. Thanks Bob.
http://support.microsoft.com/kb/169882
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Macro to determine chart name

If you are *sure* each sheet only has one chart
With ActiveSheet.ChartObjects(1).Chart.Axes(xlValue)
'etc

Otherwise go with Bob's suggestion
(to manually change a chartobject's name:
hold Ctrl+Shift, new name in the Names box left of input bar)

Regards,
Peter T


"Fan924" wrote in message
...
I have multiple sheets and there is a single chart on each sheet. I
want to use this macro but not all charts are named Chart1. Is there a
way the macro can be made to work no matter what the chart name is?

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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Macro to determine chart name

You can also do it by holding down shift and then click the embedded chart
once. This has the advantage of the cursor changing to an arrow-headed
cross, good visual feedback.


--
__________________________________
HTH

Bob

"Fan924" wrote in message
...
On Sep 30, 6:14 am, Fan924 wrote:
On Sep 30, 12:52 am, "Bob Phillips" wrote:

Why don't you just select the chart on each sheet and rename it, give
them
all the same name.


I did think of that. I hane no idea how to rename a chart. How is it
done? Excel97


I found this and it tells me how to do it. Thanks Bob.
http://support.microsoft.com/kb/169882


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 if a chart exists Matt S Excel Programming 4 May 1st 09 11:21 PM
Using a formula to determine variable rows in Chart SA Roberts Charts and Charting in Excel 4 June 30th 07 05:14 PM
Determine if data label overlaps chart title? Kate Charts and Charting in Excel 7 March 24th 07 02:24 PM
determine colouring of variables of a pie chart Menjo Charts and Charting in Excel 1 August 8th 05 11:28 PM


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