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: 2
Default Change Multiple chart source data

I have 200 charts (7 on each page)with one data page. I'd like to be
able to loop through the pages and charts and the row addresses. My
goal is to be able to change the column address from "f" to say "h"
for example, and have the macro loop through all the pages, charts
and range addresses.

I've figured out how to loop through activating the page and the
charts on each page, but can't figure out how to express the range
statement

.Range("A2:f6"),

with variables so I can loop through the row values for each chart.
I've tried statements like this -- but no luck. Am I just getting the
syntax wrong?

ActiveChart.SetSourceData Source:=Sheets("Sheet23").Range("A" &
"z" & ":" & "F" & "y"), _
PlotBy:=xlRows


I would like to loop rather than having 200 statement like this since
the column names are the same throughout and the row numbers increment
by 7.

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData
Source:=Sheets("Sheet23").Range("A2:f6"), _
PlotBy:=xlRows

ActiveSheet.ChartObjects("Chart 2").Activate
ActiveChart.PlotArea.Select
ActiveChart.SetSourceData
Source:=Sheets("Sheet23").Range("A9:f13"), _
PlotBy:=xlRows

ActiveSheet.ChartObjects("Chart 3").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData
Source:=Sheets("Sheet23").Range("A16:f20"), _
PlotBy:=xlRows


Your help will be appreciated. Thank You.
Renate
 
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
Change Source Data in Chart Karen Charts and Charting in Excel 3 August 15th 08 09:30 PM
Change source data of a pivot chart MRIreland Charts and Charting in Excel 1 July 23rd 08 03:15 PM
Edit Chart to Change Source Data wamiller36 Charts and Charting in Excel 2 July 2nd 08 07:17 AM
Change source data in a pivot chart johnb Charts and Charting in Excel 4 September 12th 07 04:40 PM
change chart source from range to raw data daithimcc Excel Programming 2 December 27th 03 05:19 PM


All times are GMT +1. The time now is 12:53 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"