Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Untested
For Each cell In Selection With cell If IsDate(.VAlue) Then If Year(.Value) = 2006 Then .Value = DateSerial(Year(.Value)-2,Month(.value),Day(.Value)) End If End If End With Next cell -- HTH Bob Phillips (remove nothere from email address if mailing direct) "cdbiggs" wrote in message ... I'm trying to write a sub that will take a date from a given cell - say 1/01/2006, and then change that to read 1/01/2004. I would physically go in to do it to each cell, however, there' s over 10,000 cells, and I thought a program would be easier. Any assistance in this matter would be greatly appreciated. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing year in a data cell | Excel Discussion (Misc queries) | |||
convert day of year to numeric value format year+day in 4 digits | Excel Worksheet Functions | |||
Automatically changing Year | Excel Discussion (Misc queries) | |||
changing the year of a date | Excel Worksheet Functions | |||
Changing the year only in a date | Excel Programming |