Im using this code to change numbers to a time format without having to insert a ":" every time,
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 39 Or Target.Column > 43 Then Exit Sub
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
the problem is it is checking every row and changing cells i dont want changing, i only need it to change rows 6 to 38, how do i modify this code to still check the same columns starting at row 6 and ending with row 38
im also getting a RunTime error13 type mismatch message if i right click and clear contents from those columns the code is checking, anyone any ideas.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 39 Or Target.Column > 43 Then Exit Sub
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
the problem is it is checking every row and changing cells i dont want changing, i only need it to change rows 6 to 38, how do i modify this code to still check the same columns starting at row 6 and ending with row 38
im also getting a RunTime error13 type mismatch message if i right click and clear contents from those columns the code is checking, anyone any ideas.