Thread: current year
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default current year

This is exactly what I wanted OssieMac. Thanks so much!!
"OssieMac" wrote:

Hi again Rob,

Is this what you are looking for?

Dim strYear As String
strYear = Year(Date) 'Year of today's date

Selection.Replace What:="200*", _
Replacement:=strYear, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False, _
SearchFormat:=False, _
ReplaceFormat:=False

Regards,

OssieMac
"Rob" wrote in message
...
Here is what I have written thus far:

Selection.Replace What:="200", Replacement:="2009", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

I want to replace the "What" portion with "200" and a wild card like (*)
to
capture all years and the Replacement clause with the current year. (Not
just 2009 but any current year).