Hi all,
I have been trying to locate parts of a time value and have those parts adjusted to a suitable format.
The problem is, the time value is written in a number of ways. These are all the possible ways they are written:
1-09.30
1-09.3
1-9.30
1-9.3
1:09.30
1:09.3
1:9.30
1:9.3
1-09-30
1-09-3
1-9-30
1-9-3
These examples are all the same value, just written differently.
What I am trying to achieve is for all times to end up looking like the 1st example "1-09.30". So for the example "1-9.30", I need a "0" added in front of the "9". For the example "1-9.3", I need a "0" put in front of the "9", and a "0" put after the "3".
The seperating characters "-" "." ":" can be any combination of the 3.
I've used this code which works for the 2nd time example, but obviously not for the 3rd and 4th examples.
If Len(t) = 6 Then t = t & 0
hope someone can help?
Thanks,
Yappa
Bookmarks