B
bw
What's wrong with this? After entering data, the focus is still in the same cell. I want to
advance to the next cell without pressing the <Enter> key again.
Option Explicit
Public Kount
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim NewVal, ValTyped
If Kount = 0 Then
If Target.Address = "$E$12" Then
Range("E12").Select
ValTyped = ActiveCell.FormulaR1C1
NewVal = Left(ValTyped, 2) & "/" & Mid(ValTyped, 3, 2) & "/" & Right(ValTyped, 2)
Kount = 1
ActiveCell = NewVal
End If
End If
Kount = 0
End Sub
Thanks,
Bernie
advance to the next cell without pressing the <Enter> key again.
Option Explicit
Public Kount
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim NewVal, ValTyped
If Kount = 0 Then
If Target.Address = "$E$12" Then
Range("E12").Select
ValTyped = ActiveCell.FormulaR1C1
NewVal = Left(ValTyped, 2) & "/" & Mid(ValTyped, 3, 2) & "/" & Right(ValTyped, 2)
Kount = 1
ActiveCell = NewVal
End If
End If
Kount = 0
End Sub
Thanks,
Bernie