Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bing
 
Posts: n/a
Default Referencing worksheet CODENAME in a chart object.

Hi all,

I have an excel chart (generated by the Chart Wizard) that references the
worksheet NAME. For example, when i right click on chart, and select 'Source
Data' i see the 'Data Range' reference the worksheet NAME as follows:

='Main Menu'!$D$13:$D$14,'Main Menu'!$E$13:$E$14

But the 'Main Menu' worksheet has a CODE NAME of of "Main". I've tried
numerous permutations but i just cannot get this chart's Data Range to
reference the worksheet CODE NAME instead.

Can anyone help?

Thanks

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

How about:

ActiveChart.SetSourceData Source:=Main.Range("d13:e14")

When I recorded a macro, the range was combined into one reference.

Even this way worked:

ActiveChart.SetSourceData Source:=Main.Range("A1:A21,C1:C21"), _
PlotBy:=xlColumns



Bing wrote:

Hi all,

I have an excel chart (generated by the Chart Wizard) that references the
worksheet NAME. For example, when i right click on chart, and select 'Source
Data' i see the 'Data Range' reference the worksheet NAME as follows:

='Main Menu'!$D$13:$D$14,'Main Menu'!$E$13:$E$14

But the 'Main Menu' worksheet has a CODE NAME of of "Main". I've tried
numerous permutations but i just cannot get this chart's Data Range to
reference the worksheet CODE NAME instead.

Can anyone help?

Thanks


--

Dave Peterson
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
How do I remove empty chart plots from linked worksheet charts Lee IT Charts and Charting in Excel 3 January 31st 05 04:31 PM
Chart Wizard "as object in:" turned off nedrgr21 Excel Discussion (Misc queries) 2 January 26th 05 06:35 AM
Date updates from worksheet to chart & changes date to a date series! Help!! Jayjg Charts and Charting in Excel 2 January 22nd 05 03:00 PM
How To Refresh Chart Data Without Calculating The Worksheet Carl Bowman Charts and Charting in Excel 5 January 19th 05 09:28 PM
Can't save chart as object in current sheet Ann Scharpf Charts and Charting in Excel 1 December 3rd 04 11:24 PM


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