Add time & day Function

ymeyaw

New Member
Joined
Apr 24, 2006
Messages
29
Dear all,

Is there a function in VB that i can use to add Eg:9 hours for "time" and automatically add 1 day to my date (if time after added 9 hours had exceed 23:59:59)?


Date Time
07/11/2011 19:23:45
07/11/2011 19:23:53
08/11/2011 3:46:02

Thanks alot ..
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi Vog,

Thanks . In this case i need to join my time column and date column before i use DateAdd?
 
Upvote 0
Hi Vog,

Thanks. I joined them , use DateAdd and split them again and it works!!!~

Thanks alot for your help!!





Do While Not ActiveSheet.Cells(a, "F").Value = ""


LDate = Cells(a, "B") & " " & Cells(a, "C")

LDate_Local = DateAdd("h", 9, LDate)



Cells(a, "B") = DateValue(LDate_Local)
Cells(a, "C") = TimeValue(LDate_Local)
 
Upvote 0

Forum statistics

Threads
1,196,508
Messages
6,015,615
Members
441,906
Latest member
gafoor

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