help required
Im using this code to insert a colon into a set of 4 numbers, and it works great but i only want it to check and change two columns, at the moment it checks and changes the whole sheet, how do i edit the code to only check colums 8 and 9.
Private Sub Worksheet_Change(ByVal Target As Range)
userinput = Target.Value
If userinput > 1 Then
newinput = Left(userinput, Len(userinput) - 2) & ":" & Right(userinput, 2)
Application.EnableEvents = False
Target = newinput
Application.EnableEvents = True
End If
End Sub
Im using this code to insert a colon into a set of 4 numbers, and it works great but i only want it to check and change two columns, at the moment it checks and changes the whole sheet, how do i edit the code to only check colums 8 and 9.
Private Sub Worksheet_Change(ByVal Target As Range)
userinput = Target.Value
If userinput > 1 Then
newinput = Left(userinput, Len(userinput) - 2) & ":" & Right(userinput, 2)
Application.EnableEvents = False
Target = newinput
Application.EnableEvents = True
End If
End Sub