whazzzzzupp17
New Member
- Joined
- Jul 23, 2018
- Messages
- 21
Hello, I created a code to hide columns if the cell in the first row contains "H".
I'm having trouble modifying this code to apply it to (3) other sheets. (data1, data2, data3)
How do I create this other than clicking each sheet and re-running the macro.
I'm having trouble modifying this code to apply it to (3) other sheets. (data1, data2, data3)
How do I create this other than clicking each sheet and re-running the macro.
VBA Code:
Sub Hide()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim H As Range
For Each H In Range("A1:Z1").Cells
If H.Value = "H" Then
H.EntireColumn.Hidden = True
End If
Next H
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub