LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default selecting multiple charts

Do you want to select all the chart sheets? Try this:

ActiveWorkbook.Charts.Select

To select only some of them, you need to select an array of chart names:

ActiveWorkbook.Charts(Array("Chart1", "Chart2")).Select

I retooled your macro slightly and it worked fine (your original one did
not, and ten seconds of deep thought couldn't shed any light).

Sub macro2()
Dim x As Long
Dim chrts() As String
ReDim chrts(1 To ActiveWorkbook.Charts.Count)
For x = 1 To ActiveWorkbook.Charts.Count
chrts(x) = ActiveWorkbook.Charts(x).Name
Next x
ActiveWorkbook.Charts(chrts).Select
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

mrmac wrote:
I am trying to programmatically copy x number of charts
from one workbook to another. I have tried replicating a
recorded macro, using a string to represent the names of
the tabs in the workbook. It comes up with "Subscript Out
of Range" error. What's the right way to do this?

Sub macro1()
chrts = Chr(34)
For x = 1 To Charts.Count
chrts = chrts & Charts(x).Name & Chr(34) & Chr(44) & Chr
(32) & Chr(34)
Next x
chrts = Left(chrts, Len(chrts) - 3)
Sheets(Array(chrts)).Select
End Sub

Thanks for any help


 
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
multiple row selecting climate Excel Worksheet Functions 3 October 23rd 08 01:26 PM
How do I keep from selecting multiple cells Ricochet Excel Worksheet Functions 2 April 29th 08 06:11 PM
Charts - How to have multiple charts share a legend. Sean Charts and Charting in Excel 2 November 20th 07 04:49 AM
Selecting Embedded charts in Active Sheets programmatically Barb Reinhardt Charts and Charting in Excel 5 January 15th 06 02:36 PM
Selecting lots of charts pwermuth Excel Discussion (Misc queries) 4 July 8th 05 03:36 PM


All times are GMT +1. The time now is 10:37 PM.

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"