Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default MACRO HELP NEEDED!

Hi

As the data is in the same location on each sheet, one way
would be to record a macro while you copy from sheet1 to
sheet 2 and make the changes to the data source. This
will give you the basis of your macro.

Edit the macro to remove the fixed reference to the new
chart name and replace it with something like

ActiveSheet.ChartObjects(1).Activate

When it comes to the source data, then replace the
original (something like)
ActiveChart.SetSourceData Source:=Sheets("sheet2").Range
("B1:H2"), PlotBy:= _
xlRows
with something like
ActiveChart.SetSourceData Source:=Sheets
(ActiveSheet.Name).Range("B1:H2"), PlotBy:= _
xlRows

You will have to build some form of loop to get through
all the sheets in the workbook (for i = 1 to
worksheets.count; sheets(i).select

This will have to be tempered to make sure that you don't
use the source sheet, or any sheet that you have already
done (if activesheet.name = "sheet1" then 'skip the
looping process).

Probably pay to copy the graphs to each of the sheets
first, then go back and grab each graph, then update the
data reference.

HTH

Tony

-----Original Message-----
does anyone have any suggestions for a macro to update

the source data for a chart when it is on a different
sheet? i have a couple charts that i have developed based
on data in sheet 1. i would like to replicate those
charts for data contained in sheet 2, then sheet 3, etc (i
have 60 sheets total). the data in sheet 2, sheet 3, etc.
is in the exact same location, but just referring to a
different project. i've started doing this manually and
it will be very time consuming.

is there some type of edit/replace feature that i could

use in a macro? or a box asking for the new source data
sheet (all the data locations remain the same)?

any assistance would be greatly appreciated.

.

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
VBA Macro needed Jeff Excel Discussion (Misc queries) 3 October 5th 07 10:50 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
MAcro Needed Nimish Excel Discussion (Misc queries) 1 October 9th 06 04:05 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 03:36 AM.

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"