Thread: Validate Year
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Validate Year

Something like this maybe...

CellYear = Year(Range("A1").Value)
If CellYear < Year(Now) Or CellYear Year(Now) + 1 Then
MsgBox "That is not a good date!"
End If

--
Rick (MVP - Excel)


"Ron" wrote in message
...
Hello all,

I need code to confirm that the date in a cell is either in the
current year or the upcoming year and flag it if it's not. Assistance
appreciated. Thanks, Ron