View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Need macro to add 100 years to a cell's date

One way:

With Range("A1")
.Value = DateAdd("yyyy", 100, .Value)
End With

In article ,
aligatrjoe wrote:

I am using Office 2003. I know how to write a formula in a new cell and set
it equal to a different cell's date plus 100 years. I can then copy new
formula and paste special to original cell. But I sure can't figure out how
to do this with a macro. I am thinking I declare a variable as myDate, set
myDate = Cell(A1), then add 100 years to myDate, then pastespecial to
cell(a1). But I can't get this to work. Any help would be greatly
appreciated.