Adding Time (minutes) with correct format

ARW17

Board Regular
Joined
Oct 31, 2016
Messages
109
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!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Try

Format(TimeValue(Worksheets("Staffing").Cells(xa, 18) + TimeValue("00:15")), "H:MM AM/PM")
 
Upvote 0
Try this.
Code:
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)+TimeSerial(0,15,0), "H:MM AM/PM")
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,725
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top