Running a Macro Automatically

Closed
Vikram - Jul 16, 2014 at 12:53 AM
 Blocked Profile - Jul 16, 2014 at 03:08 PM
Hi Guys,

I'm using the below code in VBA to hide and unhide colums in Excel.
Sub Hide()

If Range("A1") = "Summary" Then
Columns("B:Z").Hidden = True
Else
Columns("B:Z").Hidden = False
End If

Application.ScreenUpdating = True

End Sub

Although the macro is working, it is not running automatically. What am i missing to solve this. Any help would be greatly appreciated.

Cheers.

Vik.

1 response

Blocked Profile
Jul 16, 2014 at 03:08 PM
Hey Vic. What do you wish to have it check after each entry into a cell, build the macro and and put it into the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

End Sub


Give that a shot. Otherwise, at what point do you wish to qualify the action?
0