Searched for this and didn't see a solution that used a link instead of a command button.
I have two very basic macros: one that shows gridlines, headings and the formula bar, and a second one that hides them.
I want use a sinle link in cell H1 that alternates between the two macros. The sheet would open with everything hidden (macro called HideWork) and the text link in the cell reading Show Work. If I click the link (running the macro called ShowWork) the macro runs and the text link in H1 changes to Hide Work.
Here's the macros I have so far:
I have two very basic macros: one that shows gridlines, headings and the formula bar, and a second one that hides them.
I want use a sinle link in cell H1 that alternates between the two macros. The sheet would open with everything hidden (macro called HideWork) and the text link in the cell reading Show Work. If I click the link (running the macro called ShowWork) the macro runs and the text link in H1 changes to Hide Work.
Here's the macros I have so far:
VBA Code:
Sub ShowWork()
ActiveWindow.DisplayGridlines = True
ActiveWindow.DisplayHeadings = True
Application.DisplayFormulaBar = True
End Sub
VBA Code:
Sub HideWork()
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayHeadings = False
Application.DisplayFormulaBar = False
End Sub