I would like to add a macro to my workbook that unhides columns across 3 worksheets when I click in A1 on any of those worksheets. Here is what I have thus far:
Macro to Unhide columns across those sheets:
I am looking for some guidance on how I can execute this code when A1 is clicked on any of sheets 6, 7 or 8.
Thank you!
Macro to Unhide columns across those sheets:
Code:
Sub OpenColumnsSummary()
Dim wsMySheet As Worksheet
Application.ScreenUpdating = False
For Each wsMySheet In Sheets(Array(Sheet6.Name, Sheet7.Name, Sheet8.Name))
With wsMySheet
.Columns("J:M").EntireColumn.Hidden = False
.Columns("N:Q").EntireColumn.Hidden = False
.Columns("R:U").EntireColumn.Hidden = False
.Columns("V:Y").EntireColumn.Hidden = False
.Columns("Z:AC").EntireColumn.Hidden = False
.Columns("AD:AG").EntireColumn.Hidden = False
End With
Next wsMySheet
Application.ScreenUpdating = True
End Sub
I am looking for some guidance on how I can execute this code when A1 is clicked on any of sheets 6, 7 or 8.
Thank you!