I'm working with a spreadsheet with two columns, in which one of the columns is a time. I have loaded the data into a dictionary using the time as a key. I want to look up the data corresponding to a particular time (easy), and then get the next data point so that I can compare their values. The data is recorded such that one piece of data is generated every second over a period of around two hours.
My question is, does VBA in Excel have a function which can automatically add one second to a time? Or do I need to manually write one?
Update: In addition to the answers below, I have also found the "DateAdd" function useful - I suspect it depends on the version of Excel being used.
you should be able to use Time(hour, minute,second) function to add a second to the time.
so to add 1 second to a date with something like Date(2012,1,16) + Time(0,0,1)
which should result in a value of "2012-01-16 12:00:01 AM"
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