I am making a production schedule, and would like to add ex. 78 minutes to a time ex. 7:05 (am) in VBA. How would I go about doing this? This is what I have tried so far, but I'm getting an error 13 type:mismatch
Dim TUntilPump As Integer
Dim TFPump As Long, TStartPump As Long
TUP = 78
TFP = Time(0, TUP, 0)
TSP = Time(7,05,0) + TFP
I'm thinking it has something to do with my variable dimensions or the format of my times, but I have no idea what I'm doing wrong. Any help is appreciated, and thanks in advance!
1. If you want to add one minute to cell, use this formula:=A2+1/1440, if you want to add one second to cell, use this formula: =A2+1/86400. 2. In above formulas, 1 indicates to add one hour or one minute or one second, you can change it as you need.
Use the VBA Application. Wait method to pause your macro for a specific amount of time. Application. Wait is a simple way to delay your macro by a fixed number of seconds.
use the DATEADD function:
TRP = dateadd("n",78,"7:05:00")
the "n" means minutes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With