Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hello,
I have 3 chartobjects "layered" on top of each other in a worksheet. Based on a cell value, I want to "BringToFront" the correct chart. I have named the charts by getting the first chart on top, holding the CTRL key while clicking in the chart area, then change the name in the Cell indicator to the left of the formula bar. I have named the charts Chart1, Chart2 & Chart 3, this way in the order in which I want them to appear basis the cell number (1,2,3). In my code on the Worksheet("Graphs") code page, I cannot get the syntax correct to "bringtofront" the correct sheet. I've tried everything I can get my hands on.... activate, chart, chartobject, bringtofront, (1), (Chart1), ("Chart1"), etc... I keep getting the "Application or Object defined error. Please advise. I'm all ears. Thanks, Randy |
#3
![]() |
|||
|
|||
![]()
Hint: Turn on the macro recorder, then manually perform the task you wish to
automate. That's how I learned this: ActiveSheet.Shapes("Chart 1").ZOrder msoBringToFront Other arguments for ZOrder are msoSendToBack, msoBringForward, and msoSendBackward. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ RAP wrote: Hello, I have 3 chartobjects "layered" on top of each other in a worksheet. Based on a cell value, I want to "BringToFront" the correct chart. I have named the charts by getting the first chart on top, holding the CTRL key while clicking in the chart area, then change the name in the Cell indicator to the left of the formula bar. I have named the charts Chart1, Chart2 & Chart 3, this way in the order in which I want them to appear basis the cell number (1,2,3). In my code on the Worksheet("Graphs") code page, I cannot get the syntax correct to "bringtofront" the correct sheet. I've tried everything I can get my hands on.... activate, chart, chartobject, bringtofront, (1), (Chart1), ("Chart1"), etc... I keep getting the "Application or Object defined error. Please advise. I'm all ears. Thanks, Randy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hints And Tips For New Posters In The Excel Newsgroups | Excel Worksheet Functions | |||
Data Validation Syntax Question | Excel Discussion (Misc queries) | |||
syntax question - cell references in VB code | New Users to Excel | |||
An easy macro question and one I believe to be a little more diffi | Excel Worksheet Functions | |||
Previous Post - Correct Syntax Query | Excel Worksheet Functions |