Thank you all for your replies,
I've tried the differnet methods, and here is what I'm coming up with. Both methods work find in the excel sheet, but I can't get the right format to come up in my form.
I have a form that provides the data from all the calculation, and it doesn't matter which method I use, when I reference cell H5 in the form, it comes out looking horrible. In my current entry, cell H5 shows 13:12 hours, in the form it comes up as 0.55000000000291.
This is the code in the Form
Private Sub UserForm_initialize()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("CalcSheet")
txtName.Value = Worksheets("Data").Range("a2")
txtDate.Value = Format(Date, "dd-mmm-yyyy")
txtTime.Value = Time()
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(0, 0).Row
txtStartTime.Value = ws.Cells(iRow, 2).Value
txt24.Value = ws.Cells(iRow, 3).Value
txt48.Value = ws.Cells(iRow, 4).Value
txt72.Value = ws.Cells(iRow, 5).Value
txtEndTime.Value = ws.Cells(iRow, 6).Value
txtTimeSpent.Value = ws.Cells(iRow, 8).Value
End Sub
Where txtTimeSpent.Value is the value in cell H5
Almost there, but not quite.
Soma
Bookmarks