Forum Discussion
macro recording for recording and updating hour and minutes data to the current time
- Sep 30, 2021
Range("E6").Value = Range("B6") + TimeSerial(Range("E10").Value, Range("E11").Value, 0)
If it worked for you, dont forget to flag it as solved.
Remember that hitting the like button is less costly than buying me a coffee.
You can do it without you need use a VBA, but as you request it using vba...
CellWithHours and CellWithMinutes are those ones where you input manually the Hours and the minutes.
StartDate is the cell reference you use on your spreadsheet.
Remember to change all of these variable names to the actual address of the cell.
YourOutputWillBe=DateAdd("h", CellWithHours, StartDate) + DateAdd("n", CellWithMinutes, StartDate)
thank you for the reply.
I tried using the formula but it dint work as expected, I guess there is something wrong in my syntax that I have used.
In the attachment I expected the time to increase by 2hours and 30 minutes but it is showing 12:30Pm, also I want the current date to change to next date once the time crosses 12:00Am.
Can you please help me with the syntax based on the file I have shared. It would be really helpful.
Thank you.
- Juliano-PetrukioSep 29, 2021Bronze ContributorTakes more time for us to understand your snapshots. I would suggest you post some sample file.
- UG_1180Sep 29, 2021Copper Contributor
- Juliano-PetrukioSep 30, 2021Bronze Contributor
Range("E6").Value = Range("B6") + TimeSerial(Range("E10").Value, Range("E11").Value, 0)
If it worked for you, dont forget to flag it as solved.
Remember that hitting the like button is less costly than buying me a coffee.