Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 9
Default How do I move a chart using a macro?

Hi, all,

I have a nice little macro that creates two charts on several worksheets in
a workbook.

My problem is that it places one chart right on top of the other. I just
need to offset it enough to see both charts, or at least to remind myself
that there are two of them there.

I tried variations of the "Activechart.parent . . . ." commands I found
elsewhere on the site, but I always get the debug screen when I get there.

I'm using OFFICE 2007 and Vista.

Thank you

Jim
--
JP Cummings
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 71
Default How do I move a chart using a macro?

Assuming you know what cell you want as the top left cell position for the
chart, you can do something like this:

Dim chtObj As ChartObject
Set chtObj = ActiveSheet.ChartObjects(1)
chtObj.Left = Cells(2, 2).Left
chtObj.Top = Cells(2, 2).Top

and for the 2nd chart, just modify to set its position.

If you type "chtObj." (don't forget the period), you will see a set of
properties, many of which you can set.

Robert Flanagan
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Cummings" wrote in message
...
Hi, all,

I have a nice little macro that creates two charts on several worksheets
in
a workbook.

My problem is that it places one chart right on top of the other. I just
need to offset it enough to see both charts, or at least to remind myself
that there are two of them there.

I tried variations of the "Activechart.parent . . . ." commands I found
elsewhere on the site, but I always get the debug screen when I get there.

I'm using OFFICE 2007 and Vista.

Thank you

Jim
--
JP Cummings



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 move to another cell Frappier New Users to Excel 8 November 11th 08 02:06 PM
How to draw a line on a chart, and have it move with the chart? manxman Charts and Charting in Excel 5 September 27th 06 09:31 PM
How do i move a chart ExcelUser123 Charts and Charting in Excel 2 May 17th 06 09:28 AM
Macro to move to next column iblonger Excel Discussion (Misc queries) 9 January 3rd 06 05:18 PM
Macro - Find a value and then move down Phil Osman Excel Discussion (Misc queries) 4 August 10th 05 01:20 PM


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