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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
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,214,584
Messages
6,120,387
Members
448,956
Latest member
JPav

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