Adding 15 minutes to a time variable in VBA

jag108

Active Member
Joined
May 14, 2002
Messages
433
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Hi, another one that is giving me a headache.

I am settting two values for DTPickers, one with DTPicker1.value = Format(now(), "hh:mm") as the value the other to be DTPicker.value = Format(DTPicker1.value + 15, "hh:mm") but I am getting no where fast.

The answer is probably so simple, but I just cant see it for the life of me...

Help!!! please
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi agihcam,
the returned value is the same as the TimeValue = "00:15" so it did not actually add the 15 to the time already set.


Thanks for the assistance.
 
Upvote 0
Try this:

Code:
DTPicker = Format(TimeValue(DTPicker1) + TimeValue("00:15"), "hh:mm")
 
Upvote 0

Forum statistics

Threads
1,215,215
Messages
6,123,668
Members
449,114
Latest member
aides

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