I have a workbook with a lot of sheets, so we hide/unhide some as needed. I am trying to setup a toggle "button" that has been created with a shape & text. In the macro I would like the shape text to change between hide and show. I have tried several ways, but none seem to work. I drop the buttons on the sheets directly, they are not in user forms. Command buttons have not been used, because of limitations in formatting. (But I can change if this is the only way)
As always, the great help here is appreciate.
P.S. As a bonus, if there is a better way to activate the sheet if it is made visible, I am open to learning.
Code:
[FONT=Calibri]Sub MacroVisible2()[/FONT]
[FONT=Calibri]
With Worksheets("Macros")[/FONT]
[FONT=Calibri].Visible = Not.Visible[/FONT]
[FONT=Calibri].Shapes("btnHS_Macro").TextFrame.Characters.Text= IIf(.Visible, "Hide Macro Sheet", "Show Macro Sheet")[/FONT]
[FONT=Calibri]End With[/FONT]
[FONT=Calibri]If Sheets("Macros").Visible = True ThenSheets("Macros").Activate[/FONT]
[FONT=Calibri]End Sub[/FONT]
As always, the great help here is appreciate.
P.S. As a bonus, if there is a better way to activate the sheet if it is made visible, I am open to learning.