A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi Kerri,
Youv'e probabley sorted it out by now but here a couple of macros the fisrt entered in the sheet module (right-click sheet tab, select view code and paste in.
Private Sub Worksheet_Change(ByVal Target As Range)
Set vRange = Range("input2")
If Intersect(Target, vRange) Is Nothing Then
Exit Sub
Else
Application.EnableEvents = False
Target.Value = Round(Target * 96, 0) / 96
Application.EnableEvents = True
End Sub
This will round an entry in time format, with a colon to the nearest quarter of an hour. You will have to set the range Input2 in the sheet.
The second assumes that you want to enter the hours as a decimal value e.g. enter 1:27 as 1.27; 1:30 as 1.3
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myMins As Double, myHrs As Integer, myTime As Variant
Set vRange = Range("input2")
If Intersect(Target, vRange) Is Nothing Then
Exit Sub
Application.EnableEvents = False
myHrs = Int(Target)
myMins = (Target - myHrs) * 100 + myHrs * 60
myTime = Round((myMins / 1440) * 96, 0) / 96
Target.Value = Format(myTime, "hh:mm")
End if
Application.EnableEvents = True
End Sub
You will have to decide which one is suitable they do not work together.
HTH
Peter