Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I move a chart using a macro? | Charts and Charting in Excel | |||
Unspecified Automation Error | Excel Discussion (Misc queries) | |||
Unspecified Automation Error | Excel Discussion (Misc queries) | |||
Macro to automatically move chart data | Excel Programming | |||
How a macro auto-determine unspecified range | Excel Programming |