Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Name a Chart so that I can adjust it's position on the worksheet(programmatically)

When you make a new chart it is initially created on its own chartsheet
and then inserted as an object onto the required sheet. When this
happens the name gets changed which is why you are struggling to
reference it.

One way around this is to use the index of the charts on the sheet. The
most recently added chart will have the highest index number so
something like this should work if the only shapes you have on the sheet
are charts:

ActiveSheet.Shapes(ActiveSheet.ChartObjects.Count) . _
IncrementLeft 126#
ActiveSheet.Shapes(ActiveSheet.ChartObjects.Count) . _
IncrementTop -72.75

Hope this helps
Rowan

RPIJG wrote:
I tried using the Macro recorder to do this, and then assigning the
macro code to a command button on the worksheet it didn't work out so
well, I need to name the chart so that I can tell the code what chart
to move because apparently it won't accept the name it generates in the
macro code.


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
Macro to change position of chart labels on line chart Shane Henderson[_2_] Charts and Charting in Excel 1 May 27th 11 09:31 AM
how do I set up or adjust my column chart? Jerome[_3_] Charts and Charting in Excel 2 July 24th 08 11:42 AM
how do I set up or adjust my column chart? Jerome[_3_] Excel Worksheet Functions 0 July 23rd 08 02:20 PM
Chart to worksheet programmatically -- coordinates? Petr Prikryl Excel Programming 4 May 25th 05 10:57 AM
Adjust position of a commandbar quartz[_2_] Excel Programming 1 March 11th 05 06:53 AM


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