![]() |
Date question
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 |
Date question
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 |
Date question
Try somehting like:
=IF(MONTH(TODAY())<8,YEAR(TODAY()),YEAR(TODAY())+1 ) -or- If Month(Now) < 8 Then Text1 = Year(Now) Else Text1 = Year(Now) + 1 End If "Greg B" wrote: 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 |
Date question
Thank you
Didn't think of doing it that way Greg |
Date question
you're welcome and thanks for the feedback
"Greg B" wrote in message ... Thank you Didn't think of doing it that way Greg |
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 |
Date question
Hi it is saying run time error - invalid argument
What am I not doing. I wrote back without running the macro. Sorry to bother you again Greg |
Date question
replace
textbox1 with whatever you named your textbox Cheers JulieD "Greg B" wrote in message ... Hi it is saying run time error - invalid argument What am I not doing. I wrote back without running the macro. Sorry to bother you again Greg |
Date question
Hi Greg,
Struggling to know, as it works in my test. What does this bit mean? ... I wrote back without running the macro. -- HTH RP (remove nothere from the email address if mailing direct) "Greg B" wrote in message ... Hi it is saying run time error - invalid argument What am I not doing. I wrote back without running the macro. Sorry to bother you again Greg |
Date question
It is ok I have worked it out
Thanks for the help Greg |
All times are GMT +1. The time now is 02:37 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com