I have a worksheet with 2 buttons labelled "Hide" and "Show". As the names imply, they allow the user to hide or show parts of the worksheet. I would like to combine them into one button and have the button label and the associated macro change with each press of the button. Here is what I have so far;
Sub SHOW_LEADS() Rows("10:15").Select Selection.EntireRow.Hidden = False ActiveSheet.Shapes("Button 20").Select Selection.Characters.Text = "HIDE LEADS" Range("A1").Select 'is there a better way to remove the focus from the button than selecting a cell off the button? End Sub Sub HIDE_LEADS() Rows("10:14").Select Selection.EntireRow.Hidden = True ActiveSheet.Shapes("Button 20").Select Selection.Characters.Text = "SHOW LEADS" Range("A1").Select End Sub
These macros change the label fine after hiding or unhding the rows but I can't find the proper terms to use to change the macro associated with the button (if there is one?)
As always, your help is greatly appreciated!