DeanP
12-12-2018, 12:28 PM
I need to run a macro that will unhide certain hidden columns when the active cell is no longer the active cell (users will click out of the active cell to deactivate it).
I think I have found snippets of code for the 3 events:
(a) unhide columns
Columns("A:G") .EntireColumn.Hidden = False I've called this macro ShowConsole
(b) active cell not active cell
If ActiveCell.Address<>"$M$16" Then and
(c) event change
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("M16")) Is Nothing Then
Application.EnableEvents = False
Call ShowConsole
Application.EnableEvents = True
End If
End Sub
My problem is that I don't know how to bring all of this together.
I think I have found snippets of code for the 3 events:
(a) unhide columns
Columns("A:G") .EntireColumn.Hidden = False I've called this macro ShowConsole
(b) active cell not active cell
If ActiveCell.Address<>"$M$16" Then and
(c) event change
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("M16")) Is Nothing Then
Application.EnableEvents = False
Call ShowConsole
Application.EnableEvents = True
End If
End Sub
My problem is that I don't know how to bring all of this together.