What have I done wrong here? I am trying to get excel to recognise times and only accept correct 24 hour clock times though I don't know how to split it into the 3 parts needed. What I have is (its part of bigger code hence no dims et all)
time = InputBox("Enter the time") If time = "" Then End valid = True For count = 1 To count = 2 Step 1 char = Mid(time, count, 1) If (char "0" Or char > "9") Then valid = False Next count For count = 3 To count = 3 Step 2 char = Mid(time, count, 1) If (char > ".") Then valid = False For count = 4 To count = 5 Step 3 char = Mid(time, count, 1) If (char "0" Or char > "9") Then valid = False
I get some kind of erro saying for is already in use or something along those lines.
Actually no not resolved, a minor problem- it allows you to put 3 figures after the decimal (15.003 is accepted) though past 3 and it comes up with the error, how do you bring the 3 to just accepting 2?