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" <
[email protected]>
wrote in message
news:
[email protected]...