Military time trouble


D

darkbearpooh1

needa macro or something to change the time format of hh:mm to 1-12then
1-12 again instead of 13:00 so it would go from 12:30 to 1:00 instead
of 13:00
any ideas? tia
 
Ad

Advertisements

D

daddylonglegs

Is this just a formatting issue?

If you show 13:00 as 01:00 how can you tell 01:00 from 13:00? Or do you
want to show AM and PM, if so just format cell to show hh:mm AM/PM
 
D

darkbearpooh1

trouble is it makes my columns too wide to put the am or pm i even tried
editing
other areas to scrap space but this is a file that has to be printed
and can't be cut off. i don't want to differentiate between am /pm well
it can but its just too big lol. i need that format without the am pm
showing up if possible and the military format is not what i really
want
 
B

Bob Phillips

Function GetTime(rng As Range, ci As Long, Start As Boolean)
Dim cell As Range
Dim i As Long
Dim j As Long
If Start Then
For i = 1 To rng.Columns.Count
If rng.Columns(i).Interior.ColorIndex = ci Then
j = IIf(i > 25, i - 24, i)
GetTime = TimeSerial(Int(j / 2), (j Mod 2) * 30, 0)
Exit For
End If
Next i
Else
For i = rng.Columns.Count To 1 Step -1
If rng.Columns(i).Interior.ColorIndex = ci Then
j = IIf(i > 25, i - 24, i)
GetTime = TimeSerial(Int(j / 2), (j Mod 2) * 30, 0)
Exit For
End If
Next i
End If
End Function



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"darkbearpooh1" <darkbearpooh1.23gbtz_1140310801.5758@excelforum-nospam.com>
wrote in message
news:darkbearpooh1.23gbtz_1140310801.5758@excelforum-nospam.com...
 
D

darkbearpooh1

umm sorry works perfect but i just noticed the finish time is exactly 30
minutes behind the proper time it should be can you help..
 
Ad

Advertisements

D

darkbearpooh1

figured it out, i am so stupid lol, ok i fixed it by adding a extra
column and starting the out time one cell later =) thank you !!!
 
Ad

Advertisements

B

Bob Phillips

All done when I was in the land of z's <vbg>

Bob

"darkbearpooh1" <darkbearpooh1.23gp9a_1140328201.4517@excelforum-nospam.com>
wrote in message
news:darkbearpooh1.23gp9a_1140328201.4517@excelforum-nospam.com...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Military Time 4
military time 9
Military Time 2
Military Time 1
Military time 6
Using military time 4
converting military time 6
time calculation with military time 8

Top