Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Controlling the number excel gives to charts
Hello,
When creating charts in workbooks, excel will assign a number to it. So if I have 10 charts through out my project I should have charts numbered 1 thru 10. But if I delete a few and create a few more, the numbering will no longer be sequential. When automating certain processes it becomes a little difficult when charts have been numbered in this way. example. If I wanted to perform some operation on 4 of the 10 charts within a FOR NEXT loop, it would be difficult if the charts were numbered 2,4,5 and10. For Var = 1 to 4 ActiveSheet.ChartObjects("Chart "& Var).Activate blah blah blah Next How does one deal with this dilemma? I have looked (seems like everywhere) for a place where I can re-number the charts. Or are there other options? Thanks, Gerry |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Controlling the number excel gives to charts
GC;584045 Wrote: Hello, When creating charts in workbooks, excel will assign a number to it. So if I have 10 charts through out my project I should have charts numbered 1 thru 10. But if I delete a few and create a few more, the numbering will no longer be sequential. When automating certain processes it becomes a little difficult when charts have been numbered in this way. example. If I wanted to perform some operation on 4 of the 10 charts within a FOR NEXT loop, it would be difficult if the charts were numbered 2,4,5 and10. For Var = 1 to 4 ActiveSheet.ChartObjects("Chart "& Var).Activate blah blah blah Next How does one deal with this dilemma? I have looked (seems like everywhere) for a place where I can re-number the charts. Or are there other options? Thanks, Gerry For embedded charts (not on a chart sheet) the chart object is reached with activechart.parent.name="myNewName" so set this as you will at some point when you first create the charts. -- p45cal *p45cal* ------------------------------------------------------------------------ p45cal's Profile: 558 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=161673 Microsoft Office Help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Controlling the number excel gives to charts
Try...
Sub Macro1() Dim objchart As ChartObject For Each objchart In ActiveSheet.ChartObjects 'MsgBox objchart.Name 'Use a Select CAse statement or IF condition to filter the 4 charts Next End Sub -- Jacob "GC" wrote: Hello, When creating charts in workbooks, excel will assign a number to it. So if I have 10 charts through out my project I should have charts numbered 1 thru 10. But if I delete a few and create a few more, the numbering will no longer be sequential. When automating certain processes it becomes a little difficult when charts have been numbered in this way. example. If I wanted to perform some operation on 4 of the 10 charts within a FOR NEXT loop, it would be difficult if the charts were numbered 2,4,5 and10. For Var = 1 to 4 ActiveSheet.ChartObjects("Chart "& Var).Activate blah blah blah Next How does one deal with this dilemma? I have looked (seems like everywhere) for a place where I can re-number the charts. Or are there other options? Thanks, Gerry . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Maximum number of charts--Excel 2007? | Excel Discussion (Misc queries) | |||
Controlling line colors/styles in excel charts | Charts and Charting in Excel | |||
Creating a macro to copy a number of charts from Excel to PPT | Excel Programming | |||
dynamically controlling number of lines on a graph | Excel Programming |