VBA Add minutes to date time

Опубликовано: 20 Июль 2026
на канале: Simplified Excellence
76
0

Add minutes to a date and time within your code.

Code:
Sub add_minutes()

Dim date_and_time_start As Date
Dim minutes_to_add As Long
Dim date_and_time_end As Date

'set
minutes_to_add = 60

'identify date and time - start
date_and_time_start = DateSerial(2019, 1, 1) + TimeSerial(10, 0, 0)

'add minutes to date and time to identify date and time - end
date_and_time_end = DateAdd("n", minutes_to_add, date_and_time_start)

'message
MsgBox ("The new time is: " & date_and_time_end)

End Sub

-------------------------------
NEED HELP?
-------------------------------
Leave a comment with your questions, issues or projetcs and I will try to answer with a video.

-------------------------------
THANK YOU
-------------------------------
For watching my videos,
Your shares
And your comments!