Hello,
I've got this VBA code below (mr excel members wrote it for me and it works great) for a worksheet.
However It does not work if worksheet is protected with password.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("B23:HN23")) Is Nothing Then
If UCase(Target.Value) = "SAMPLE" Then
MsgBox ("Please fill the next column!")
End If
End If
On Error GoTo Err:
If Application.Intersect(Target, Range("B8")) = "New Zealand" Then
Rows("22:23").EntireRow.Hidden = True
End If
If Application.Intersect(Target, Range("B8")) = "Australia" Then
Rows("22:23").EntireRow.Hidden = False
End If
Err:
End Sub
Could anyone help me to have the code working with worksheet protection?
Thank you so much
Regards,
HJY
I've got this VBA code below (mr excel members wrote it for me and it works great) for a worksheet.
However It does not work if worksheet is protected with password.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("B23:HN23")) Is Nothing Then
If UCase(Target.Value) = "SAMPLE" Then
MsgBox ("Please fill the next column!")
End If
End If
On Error GoTo Err:
If Application.Intersect(Target, Range("B8")) = "New Zealand" Then
Rows("22:23").EntireRow.Hidden = True
End If
If Application.Intersect(Target, Range("B8")) = "Australia" Then
Rows("22:23").EntireRow.Hidden = False
End If
Err:
End Sub
Could anyone help me to have the code working with worksheet protection?
Thank you so much
Regards,
HJY