ian_bamforth
05-11-2010, 01:34 AM
Hi,
I have a bunch of times stored as hh:mm, and I want to be able to add a set period (i.e. an hour or a minute) to a time within some VBA. I have made several attempts along the lines of:
ActiveCell.Value = ActiveCell.Value + "00:01"
...with the intention of adding a minute to the current cell. Debugging reveals that the value of the active cell is processed as a number <1, as expected, but there is type mismatch when the "00:01" is added. If the original cell is blank (i.e. 0), the assignment works, and returns 00:01.
Pretty sure this should be very straightforward, and I'm missing something obvious - can anyone point me in the right direction please?
Ian
I have a bunch of times stored as hh:mm, and I want to be able to add a set period (i.e. an hour or a minute) to a time within some VBA. I have made several attempts along the lines of:
ActiveCell.Value = ActiveCell.Value + "00:01"
...with the intention of adding a minute to the current cell. Debugging reveals that the value of the active cell is processed as a number <1, as expected, but there is type mismatch when the "00:01" is added. If the original cell is blank (i.e. 0), the assignment works, and returns 00:01.
Pretty sure this should be very straightforward, and I'm missing something obvious - can anyone point me in the right direction please?
Ian