Hi,
Below is VBA i would like to run when one of my sheets changes.
But when I refresh all it seems to run on each tab.
As the VBA will only work on one of the tabs. It gives a debug error.
How can i limit the VBA to run on a specific tab only.
Below is VBA i would like to run when one of my sheets changes.
But when I refresh all it seems to run on each tab.
As the VBA will only work on one of the tabs. It gives a debug error.
How can i limit the VBA to run on a specific tab only.
VBA Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
Columns("D:O").Select
Selection.EntireColumn.Hidden = False
For Each c In Range("D1:L1").Cells
If c.Value = "0" Then
c.EntireColumn.Hidden = True
'You can change the property above to False
'to unhide the columns.
End If
Next c
End Sub
Last edited by a moderator: