Thread: Date question
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Date question

How about shortening it?

Private Sub UserForm_Initialize()
Me.TextBox1.Value = Year(Date)-1*(Month(Date)6)
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JulieD" wrote in message
...
Hi Greg

like this?
-------
Private Sub UserForm_Initialize()
If Month(Now()) <= 7 Then
Me.TextBox1.Value = Year(Now())
Else
Me.TextBox1.Value = Year(Now()) + 1
End If
End Sub
--------
Cheers
JulieD

"Greg B" wrote in message
...
I want to put a text box which suggests the year.

I would like it to suggest the current year until after july when the
program will need to suggest next year.

Thanks in advance

Greg