This is my first post and I've read a few other postings about time, but I can't seem to get mine to work.
I had the following, which works, but I need to add 15 minutes to the 2nd time (underlined below):
If Worksheets("Staffing Comp").Range("D1") = "Friday" Then
Sheets("Staffing").Select
Dim xe As Integer
For xe = 199 To 233
If Cells(xe, 13) = Worksheets("Self-Service Schedule").Range("B1") Then
Worksheets("Change Log").Range("G65536").End(xlUp).Offset(1, 0) = Format(Worksheets("Staffing").Cells(xe, 16), "H:MM AM/PM") & " to " & Format(Worksheets("Staffing").Cells(xa, 18), "H:MM AM/PM")
I tried: Format(TimeValue(Worksheets("Staffing").Cells(xa, 18)) + TimeValue("00:15"), "H:MM AM/PM"), but that gives me the error "Application-defined or object-defined error.
I've also mixed and matched with Format, TimeValue, and Time to get this sorted out, but I can't quite get it.
Help pleas!
I had the following, which works, but I need to add 15 minutes to the 2nd time (underlined below):
If Worksheets("Staffing Comp").Range("D1") = "Friday" Then
Sheets("Staffing").Select
Dim xe As Integer
For xe = 199 To 233
If Cells(xe, 13) = Worksheets("Self-Service Schedule").Range("B1") Then
Worksheets("Change Log").Range("G65536").End(xlUp).Offset(1, 0) = Format(Worksheets("Staffing").Cells(xe, 16), "H:MM AM/PM") & " to " & Format(Worksheets("Staffing").Cells(xa, 18), "H:MM AM/PM")
I tried: Format(TimeValue(Worksheets("Staffing").Cells(xa, 18)) + TimeValue("00:15"), "H:MM AM/PM"), but that gives me the error "Application-defined or object-defined error.
I've also mixed and matched with Format, TimeValue, and Time to get this sorted out, but I can't quite get it.
Help pleas!