Date not defaulting to current year

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,
I would like a user to enter JUST the Day and Month....and the year default
to 2008.
Does anyone have any ideas?
 
Right click sheet tab>view code>copy/paste this>change column to suit>format
column as desired

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 7 Then Exit Sub
Application.EnableEvents = False
Target = DateSerial("2008", Month(Target), Day(Target))
Application.EnableEvents = True
End Sub
 
Your subject line said "CURRENT" year and your msg said 2008.
On my xl2003 if if type 11/16 I automatically get the CURRENT year.
 
Thanks Don....

Don Guillett said:
Your subject line said "CURRENT" year and your msg said 2008.
On my xl2003 if if type 11/16 I automatically get the CURRENT year.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top