Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to change position of chart labels on line chart | Charts and Charting in Excel | |||
how do I set up or adjust my column chart? | Charts and Charting in Excel | |||
how do I set up or adjust my column chart? | Excel Worksheet Functions | |||
Chart to worksheet programmatically -- coordinates? | Excel Programming | |||
Adjust position of a commandbar | Excel Programming |