Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Selecting specific excel charts using VBA

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Selecting specific excel charts using VBA

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Selecting specific excel charts using VBA

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Selecting specific excel charts using VBA

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
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
Selecting only specific rows for a Sort mkflirting Excel Discussion (Misc queries) 1 April 14th 10 06:27 PM
selecting randomly specific value in a list Nicawette Excel Worksheet Functions 8 March 13th 09 04:48 PM
Selecting a specific worksheet Jackie New Users to Excel 5 February 25th 09 07:03 PM
Selecting specific cells Michelle Excel Discussion (Misc queries) 1 March 12th 08 05:06 PM
Selecting Specific Data within a Table Huge Peanuts Excel Worksheet Functions 0 February 21st 06 04:09 PM


All times are GMT +1. The time now is 07:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"