Before I pull the rest of my hair out...
I have a spreadsheet in which I'm entering start and end times, then applying a simple calculation to get the differance between the two. I'm using this VBA data to eliminate the need to type a colon-
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
-and it works great EXCEPT FOR when I have a time such as 0035 in which case it displays :35 only, which prevents the calcuation from being made. I've tried several reformattings of the cells with double-zero times but nothing works. Is there a simple solution I can apply? I'm not as tech-savvy with macro/VBA applications as I wish I was, so a cut and paste option would be greatly appreciated... or at least an "in simple terms" solution.
This messageboard is brilliant with info... hopefully someone can help me out?
Thanx muchly! ray:
~Brian
I have a spreadsheet in which I'm entering start and end times, then applying a simple calculation to get the differance between the two. I'm using this VBA data to eliminate the need to type a colon-
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
-and it works great EXCEPT FOR when I have a time such as 0035 in which case it displays :35 only, which prevents the calcuation from being made. I've tried several reformattings of the cells with double-zero times but nothing works. Is there a simple solution I can apply? I'm not as tech-savvy with macro/VBA applications as I wish I was, so a cut and paste option would be greatly appreciated... or at least an "in simple terms" solution.
This messageboard is brilliant with info... hopefully someone can help me out?
Thanx muchly! ray:
~Brian