![]() |
Index # of selected embedded chart
Hi,
Probably something simple that I missed. I'd like to access the index number (rather than text name) of the selected chart on a particular sheet. I'd like to prompt a confirmation message to a specific action a user will take that will affect the selected chart and I'd like to include the chart number in the confirmation message. As I've discovered, the name loses significance as multiple charts are created and deleted over time. There's some other work arounds that I can do but if I can activate a chart using an index number, I'd hope that I could read this same number somehow. So in my code I can envision something like.... Sub ConfirmationMsg Dim ans as integer ans = Msgbox ("You are about to change something on Chart #" & activechart.index & chr(10) & "Do you want to continue?",vbYesNo) End Sub Unfortunately, I can get any variation of *.index to work. Thanks much. |
Index # of selected embedded chart
An embedded chart on a worksheet is contained within a "ChartObject"... '--- Sub Track() MsgBox "Index = " & ActiveChart.Parent.Index & vbCr & _ "Chart object name = " & ActiveChart.Parent.Name & vbCr & _ "Chart name = " & ActiveChart.Name End Sub '--- The above only works on the active (selected) chart. -- Jim Cone Portland, Oregon USA "RLang" wrote in message Hi, Probably something simple that I missed. I'd like to access the index number (rather than text name) of the selected chart on a particular sheet. I'd like to prompt a confirmation message to a specific action a user will take that will affect the selected chart and I'd like to include the chart number in the confirmation message. As I've discovered, the name loses significance as multiple charts are created and deleted over time. There's some other work arounds that I can do but if I can activate a chart using an index number, I'd hope that I could read this same number somehow. So in my code I can envision something like.... Sub ConfirmationMsg Dim ans as integer ans = Msgbox ("You are about to change something on Chart #" & activechart.index & chr(10) & "Do you want to continue?",vbYesNo) End Sub Unfortunately, I can get any variation of *.index to work. Thanks much. |
Index # of selected embedded chart
PARENT!!!! I'll put that one in the archives. Thanks Jim.
"Jim Cone" wrote: An embedded chart on a worksheet is contained within a "ChartObject"... '--- Sub Track() MsgBox "Index = " & ActiveChart.Parent.Index & vbCr & _ "Chart object name = " & ActiveChart.Parent.Name & vbCr & _ "Chart name = " & ActiveChart.Name End Sub '--- The above only works on the active (selected) chart. -- Jim Cone Portland, Oregon USA "RLang" wrote in message Hi, Probably something simple that I missed. I'd like to access the index number (rather than text name) of the selected chart on a particular sheet. I'd like to prompt a confirmation message to a specific action a user will take that will affect the selected chart and I'd like to include the chart number in the confirmation message. As I've discovered, the name loses significance as multiple charts are created and deleted over time. There's some other work arounds that I can do but if I can activate a chart using an index number, I'd hope that I could read this same number somehow. So in my code I can envision something like.... Sub ConfirmationMsg Dim ans as integer ans = Msgbox ("You are about to change something on Chart #" & activechart.index & chr(10) & "Do you want to continue?",vbYesNo) End Sub Unfortunately, I can get any variation of *.index to work. Thanks much. |
All times are GMT +1. The time now is 01:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com