Hi all
Except YouTube tutorials I am complete new to VBA and this is my first thread ever, so be nice to me :-) . I have a course coming up in a month but I need to finish this ASAP, so I hope you guys will help me. I am making a time calculation project and I'm almost done, but I have a few hurdles that I can't pass:
1) The time input is not showed correctly.
- In Denmark we use 00:00-2359 and no AM or PM. To get the user to type only this kind of input I made some If-rules so the user can't type it differently. But I don't the user to type in the colon him self (e.g. from 1345 to 13:45). So basically I am asking how to do this a simple way?
I have tried formatting the cells in Excel with no luck. I have also tried this code:
Range("a1").Value = Left(Range("a1").Value, 2) & ":" & Right(Range("a1").Value, 2)
The code works almost fine, but not if the time is before 10:00 (between 00:00 and 09:59). What can I do?
2) Calculation across midnight
- The other problem is when start time is before 23:59 and the stop time after 00:00.
This is my code: Code.txt
I have been trying for 5 hours and I haven't got any further. Can you help me please?
Andy
Bookmarks