Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Macro to move unspecified chart

Hi



I have a macro that creates a chart, it does this well! What it doesnt do
well is place it where i want it once it is created.

The problem is that the code to move it about the page that i have:

ActiveSheet.Shapes("Chart 18").IncrementLeft 251.25
ActiveSheet.Shapes("Chart 18").IncrementTop -129.75


....obviously specifies that the chart that will be moved must be "Chart 18".
Is there anyway round this? With the amount of users this sheet is going to
have, i cannot guarantee that when the button is pressed, the chart that it
will fire will be the 18th!

Surely there must be a way of shifting it once you are already into
"ActiveChart. "?
For example, does "ActiveChart.Move" only shift between sheets?


Any help gratefully recieved, please let me know if you need more info


cheers


jb
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Macro to move unspecified chart

You can do this if it is the last chart:

ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Incre mentLeft 251.25

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"JB2010" wrote in message
...
Hi



I have a macro that creates a chart, it does this well! What it doesnt do
well is place it where i want it once it is created.

The problem is that the code to move it about the page that i have:

ActiveSheet.Shapes("Chart 18").IncrementLeft 251.25
ActiveSheet.Shapes("Chart 18").IncrementTop -129.75


...obviously specifies that the chart that will be moved must be "Chart
18".
Is there anyway round this? With the amount of users this sheet is going
to
have, i cannot guarantee that when the button is pressed, the chart that
it
will fire will be the 18th!

Surely there must be a way of shifting it once you are already into
"ActiveChart. "?
For example, does "ActiveChart.Move" only shift between sheets?


Any help gratefully recieved, please let me know if you need more info


cheers


jb



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Macro to move unspecified chart

cheers Bob


works like a charm

"Bob Flanagan" wrote:

You can do this if it is the last chart:

ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Incre mentLeft 251.25

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"JB2010" wrote in message
...
Hi



I have a macro that creates a chart, it does this well! What it doesnt do
well is place it where i want it once it is created.

The problem is that the code to move it about the page that i have:

ActiveSheet.Shapes("Chart 18").IncrementLeft 251.25
ActiveSheet.Shapes("Chart 18").IncrementTop -129.75


...obviously specifies that the chart that will be moved must be "Chart
18".
Is there anyway round this? With the amount of users this sheet is going
to
have, i cannot guarantee that when the button is pressed, the chart that
it
will fire will be the 18th!

Surely there must be a way of shifting it once you are already into
"ActiveChart. "?
For example, does "ActiveChart.Move" only shift between sheets?


Any help gratefully recieved, please let me know if you need more info


cheers


jb




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Macro to move unspecified chart

Alternatively:

ActiveChart.Parent.IncrementLeft 251.25

To set an absolute position:

ActiveChart.Parent.Left = 200

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"JB2010" wrote in message
...
cheers Bob


works like a charm

"Bob Flanagan" wrote:

You can do this if it is the last chart:

ActiveSheet.Shapes(ActiveSheet.Shapes.Count).Incre mentLeft 251.25

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"JB2010" wrote in message
...
Hi



I have a macro that creates a chart, it does this well! What it doesnt
do
well is place it where i want it once it is created.

The problem is that the code to move it about the page that i have:

ActiveSheet.Shapes("Chart 18").IncrementLeft 251.25
ActiveSheet.Shapes("Chart 18").IncrementTop -129.75


...obviously specifies that the chart that will be moved must be "Chart
18".
Is there anyway round this? With the amount of users this sheet is
going
to
have, i cannot guarantee that when the button is pressed, the chart
that
it
will fire will be the 18th!

Surely there must be a way of shifting it once you are already into
"ActiveChart. "?
For example, does "ActiveChart.Move" only shift between sheets?


Any help gratefully recieved, please let me know if you need more info


cheers


jb






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 move a chart using a macro? Cummings Charts and Charting in Excel 1 January 27th 10 02:09 PM
Unspecified Automation Error _Yoyo Excel Discussion (Misc queries) 1 May 23rd 05 08:23 PM
Unspecified Automation Error _Yoyo Excel Discussion (Misc queries) 0 May 20th 05 09:16 PM
Macro to automatically move chart data msdnquestion Excel Programming 6 March 23rd 05 01:36 AM
How a macro auto-determine unspecified range eric c Excel Programming 1 October 26th 04 07:49 PM


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