![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
In one Spreadsheet, I use FOR loop to add several chart, the chart number varies. How can i extract the chart name of the newly added chart? Thx.
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
Is it necessary that ChartObjects(1) always refer to the chart added latestly? Seems not, So how to determine the name of the newly added chart?
Please help..... |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
help please
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
|
Right click on the chart and choose assign macro. The box that comes up will have the chart name in the top line. Cancel the box, unless of course you actually want to assign a macro to the chart.
|
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
Quote:
In this example I'm just adding chart sheets rather inserting than chart objects onto sheets, but the same principle applies. _________________ [b] Mark O'Brien [ This Message was edited by: Mark O'Brien on 2002-02-28 07:15 ] |
|
|
|
|
|
|
#6 |
|
Guest
Posts: n/a
|
These codes are for newly added codes. parts of my codes are as following:
ActiveSheet.ChartObjects("Chart 36").Activate ActiveChart.ChartArea.Select ActiveChart.ChartArea.Copy ActiveWindow.Visible = False Windows("Monthly Cpk Summary-PPT.xls").Activate Range(Cells(10 * LoopP - 15, ActiveSheet.Paste 'Need to determine the chart name ActiveSheet.ChartObjects("Chart " & LoopP + 52).Activate ActiveChart.PlotArea.Select ActiveChart.SeriesCollection(1).Delete ActiveChart.SeriesCollection(1).Delete I use ActiveSheet.ChartObjects("Chart "& LoopP+52).Activate because i found that the latestly creatly chart is Chart 51. So in this case how can i name the chart? No stuff such as "MyChart", right? so no MyChart.Name. Please enlighten. |
|
|
|
#7 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
If the whole objective is to activate the last chart that was created, add this code to your project:
Now to activate the last chart in your code, simply use
Instead of:
HTH _________________ [b] Mark O'Brien [ This Message was edited by: Mark O'Brien on 2002-02-28 10:10 ] [ This Message was edited by: Mark O'Brien on 2002-02-28 10:13 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|