Hi,
Can somebody tell me what is wrong with the following code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("WK05_TRUE_FALSE").Value = False Then
Range("AI:AL").Selection.EntireColumn.Hidden = True
Else
Range("AI:AL").Selection.EntireColumn.Hidden = False
End If
End Sub
I have a cell called WK05_True_False which equals 'False' if it is NOT a 5 week period, and goes to 'True' if it is, as a month date on the front sheet is changed. When 'False' I want to hide columns AI:AL.
This macro is on the sheet to which it relates, but I keep getting
Run time error '1004'
Method Rage of object worksheet failed
Can anyone help - please?
Can somebody tell me what is wrong with the following code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("WK05_TRUE_FALSE").Value = False Then
Range("AI:AL").Selection.EntireColumn.Hidden = True
Else
Range("AI:AL").Selection.EntireColumn.Hidden = False
End If
End Sub
I have a cell called WK05_True_False which equals 'False' if it is NOT a 5 week period, and goes to 'True' if it is, as a month date on the front sheet is changed. When 'False' I want to hide columns AI:AL.
This macro is on the sheet to which it relates, but I keep getting
Run time error '1004'
Method Rage of object worksheet failed
Can anyone help - please?