PDA

View Full Version : Solved: Macro inserting colon in time returning #value! in output column



Barryj
04-28-2012, 08:14 AM
I have a macro in the attached workbook which inserts a colon when a user inserts a time.

In the hours column it should add up the difference between the two times inserted in columns E & H.

All cells in the range are formatted as hh:mm but it is showing #value! in the hours column instead of the time.

can anyone provide any info as to why it would be giving this result, is it a formatting issue or is there other issues that might be causing this problem.

Any advice appreciated.

p45cal
04-28-2012, 11:48 AM
leading space in times, change to:
NewInput = Left(UserInput, Len(UserInput) - 2) & ":" & Right(UserInput, 2)

Barryj
04-28-2012, 12:07 PM
Thanks p45cal that has rectified the problem, much appreciated.