View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Adam Adam is offline
external usenet poster
 
Posts: 287
Default Macro to change date cell by specified interval

I would like to create a macro in Excel that when executed adds or subtracts
a user specified interval of time in minutes. I would like two cells: one
with the date and the other with the interval, for example 10 minutes. When
the user executes the macro, I would like to see the date cell update. So if
the date cell was 2/12/08 1:00PM, the interval cell was 10 and you executed
the macro, the date cell updates to 2/12/08 1:10PM. Then if the macro is
executed again it would add another 10 minutes to and make the date 2/12/08
1:20PM. How would I go about achieving this. I have tried the DateAdd
function, but it only works for one execution. I want it to update and add
another 10 for the next execution.