Hi Guys,
I have a user from with an option button. When the option button is ticked and the user form is closed, the user can only use allowed characters in a selected column. This is a code I have, but it fails. Please help
Private Sub OptionButton4_Click()
Dim rng As Range
If Intersect(Target, Range("C:C")) Is Nothing Then
Application.ScreenUpdating = False
Application.EnableEvents = False
For Each rng In Intersect(Range("C2:C50000"), Target)
Select Case rng
Case "Y", "N", "N/A", ""
' OK
Case Else
rng.Value = "N"
End Select
Next rng
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
I have a user from with an option button. When the option button is ticked and the user form is closed, the user can only use allowed characters in a selected column. This is a code I have, but it fails. Please help
Private Sub OptionButton4_Click()
Dim rng As Range
If Intersect(Target, Range("C:C")) Is Nothing Then
Application.ScreenUpdating = False
Application.EnableEvents = False
For Each rng In Intersect(Range("C2:C50000"), Target)
Select Case rng
Case "Y", "N", "N/A", ""
' OK
Case Else
rng.Value = "N"
End Select
Next rng
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub