ElvisSteel
Board Regular
- Joined
- Mar 23, 2009
- Messages
- 122
I have a macro button that shows/hides a table of data (using conditional formatting in the table itself).
I want to change the text accordingly from "Show Data" to "Hide Data" each time the button is pressed.
I have code that does this by selecting the required sheet, then changing the text using
ActiveSheet.Shapes("Button").Select
Selection.Characters.Text = "Show Data" etc.
All OK at this point, but when I first open the sheet, I want to check if the data is shown, and set the button text accordingly, but I am having trouble getting this to work without having to first select the sheet.
i.e. somthing along the lines of...
Sheets("SheetName").Shapes("Button").Text etc etc
but I cannot get the properties/method right
Can anyone help please
Thanks
I want to change the text accordingly from "Show Data" to "Hide Data" each time the button is pressed.
I have code that does this by selecting the required sheet, then changing the text using
ActiveSheet.Shapes("Button").Select
Selection.Characters.Text = "Show Data" etc.
All OK at this point, but when I first open the sheet, I want to check if the data is shown, and set the button text accordingly, but I am having trouble getting this to work without having to first select the sheet.
i.e. somthing along the lines of...
Sheets("SheetName").Shapes("Button").Text etc etc
but I cannot get the properties/method right
Can anyone help please
Thanks