Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all,
Say I have an excel macro that runs on a weekly basis to generate 4 different charts in one worksheet. I now need to write a new macro to select specifically the first and the third chart from the list of 4, and paste the 2 charts to powerpoint. Does anyone have any idea how to write a macro for this? The difficulty I am facing is that, the 4 charts will not have a standardized name, since the "Chart #" will keep on increasing when the 1st macro regenerates new sets of graphs weekly. Is there a way to get VB to select specifically the first chart as Object 1 and the 3rd chart as Object 3 from the entire worksheet? Hope someone can help. I am running out of ideas. Thanks in advance for your help. Rgds, Mithi |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mithi
Why not create variables in your code and assign chart names to each variable when you are creating your charts ? You could then use these variables in the next step. HTH Cordially Pascal Why not assign variables while "Mithi_M" a écrit dans le message de om... Hello all, Say I have an excel macro that runs on a weekly basis to generate 4 different charts in one worksheet. I now need to write a new macro to select specifically the first and the third chart from the list of 4, and paste the 2 charts to powerpoint. Does anyone have any idea how to write a macro for this? The difficulty I am facing is that, the 4 charts will not have a standardized name, since the "Chart #" will keep on increasing when the 1st macro regenerates new sets of graphs weekly. Is there a way to get VB to select specifically the first chart as Object 1 and the 3rd chart as Object 3 from the entire worksheet? Hope someone can help. I am running out of ideas. Thanks in advance for your help. Rgds, Mithi |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jon Peltier has sample code in which a chart is assigned a variable as
it is created: http://www.peltiertech.com/Excel/Cha....html#addchart Mithi_M wrote: Hello all, Say I have an excel macro that runs on a weekly basis to generate 4 different charts in one worksheet. I now need to write a new macro to select specifically the first and the third chart from the list of 4, and paste the 2 charts to powerpoint. Does anyone have any idea how to write a macro for this? The difficulty I am facing is that, the 4 charts will not have a standardized name, since the "Chart #" will keep on increasing when the 1st macro regenerates new sets of graphs weekly. Is there a way to get VB to select specifically the first chart as Object 1 and the 3rd chart as Object 3 from the entire worksheet? Hope someone can help. I am running out of ideas. Thanks in advance for your help. Rgds, Mithi -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mithi -
If you can't use the variable approach for whatever reason, you could assign a more meaningful name to the chart, which the next macro can refer to when copying. This page talks about naming charts: http://peltiertech.com/Excel/ChartsH...ameAChart.html and this page has some pointers for moving charts to PowerPoint: http://peltiertech.com/Excel/XL_PPT.html - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Debra Dalgleish wrote: Jon Peltier has sample code in which a chart is assigned a variable as it is created: http://www.peltiertech.com/Excel/Cha....html#addchart Mithi_M wrote: Hello all, Say I have an excel macro that runs on a weekly basis to generate 4 different charts in one worksheet. I now need to write a new macro to select specifically the first and the third chart from the list of 4, and paste the 2 charts to powerpoint. Does anyone have any idea how to write a macro for this? The difficulty I am facing is that, the 4 charts will not have a standardized name, since the "Chart #" will keep on increasing when the 1st macro regenerates new sets of graphs weekly. Is there a way to get VB to select specifically the first chart as Object 1 and the 3rd chart as Object 3 from the entire worksheet? Hope someone can help. I am running out of ideas. Thanks in advance for your help. Rgds, Mithi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting only specific rows for a Sort | Excel Discussion (Misc queries) | |||
selecting randomly specific value in a list | Excel Worksheet Functions | |||
Selecting a specific worksheet | New Users to Excel | |||
Selecting specific cells | Excel Discussion (Misc queries) | |||
Selecting Specific Data within a Table | Excel Worksheet Functions |