G
garygoodguy
Hi,
I have some vba to hide some columns in one sheet based on a cell valu
in another sheet:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Sheets("Start").Range("U4").Value = "OFF" Then
Columns("P:AB").EntireColumn.Hidden = True
Else
Columns("P:AB").EntireColumn.Hidden = False
End If
End Sub
As you can see I have placed this code in the Worksheet_SelectionChange
This works fine, however it looks for that cell value everytime the use
moves around the sheet. What I'm after is to only look at the value onc
when the workbook opens (as it will not change from then on).
I have tried placing the code in both Private Sub's Worksheet_Change
Worksheet_Calculate, but the existing code does not work in either o
these.
Any advice would be appreciated.
Cheers
I have some vba to hide some columns in one sheet based on a cell valu
in another sheet:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Sheets("Start").Range("U4").Value = "OFF" Then
Columns("P:AB").EntireColumn.Hidden = True
Else
Columns("P:AB").EntireColumn.Hidden = False
End If
End Sub
As you can see I have placed this code in the Worksheet_SelectionChange
This works fine, however it looks for that cell value everytime the use
moves around the sheet. What I'm after is to only look at the value onc
when the workbook opens (as it will not change from then on).
I have tried placing the code in both Private Sub's Worksheet_Change
Worksheet_Calculate, but the existing code does not work in either o
these.
Any advice would be appreciated.
Cheers