Hi
I'm validating cells on worksheet change and if the value is invalid I'm trying to force the user into edit mode in that cell. I tried using the sendkeys {f2} at the end of the procedure, but this doesn't seem to be working consistently.
I want to force the user to edit the cell until they have a valid entry. Can someone help or suggest how to do this?
Here's my procedure:
Thanks
LEE
I'm validating cells on worksheet change and if the value is invalid I'm trying to force the user into edit mode in that cell. I tried using the sendkeys {f2} at the end of the procedure, but this doesn't seem to be working consistently.
I want to force the user to edit the cell until they have a valid entry. Can someone help or suggest how to do this?
Here's my procedure:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim EAddr As String, EMsg As String
'
' Test for valid email address
'
If Target.Column = 6 Then
EAddr = Cells(Target.Row, Target.Column).Value
If ValidateEmail(EAddr, EMsg) = False Then
MsgBox (EMsg)
Cells(Target.Row, Target.Column).Select
SendKeys "{F2}", False
End If
End If
End Sub
Thanks
LEE