ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Year question (https://www.excelbanter.com/excel-discussion-misc-queries/53862-year-question.html)

Greg B

Year question
 
I am having problems working out a simple little sum. I have a userform
when I have a new member join I want it to add the current year. How can I
get excel to do this the easy way. I currently have it paste the now()
value and have set the cell to show yyyy but unfortuantely when I go to the
next cell where I want to have the worksheet work out the years member
section it comes up as volitile.

Any Ideas

Thanks

Greg



Norman Jones

Year question
 
Hi Greg,

With Range("A1")
.NumberFormat = "General"
.Value = Year(Date)
End With

Change A1 to the cell of interest.

---
Regards,
Norman



"Greg B" wrote in message
...
I am having problems working out a simple little sum. I have a userform
when I have a new member join I want it to add the current year. How can I
get excel to do this the easy way. I currently have it paste the now()
value and have set the cell to show yyyy but unfortuantely when I go to the
next cell where I want to have the worksheet work out the years member
section it comes up as volitile.

Any Ideas

Thanks

Greg




pinmaster

Year question
 

Hi,
I'm not an expert but maybe something like this in your code:
Activecell.Formula = Year(Now())

HTH
JG


--
pinmaster
------------------------------------------------------------------------
pinmaster's Profile: http://www.excelforum.com/member.php...fo&userid=6261
View this thread: http://www.excelforum.com/showthread...hreadid=482391


Greg B

Year question
 
Thanks Norman work great

Greg
"Norman Jones" wrote in message
...
Hi Greg,

With Range("A1")
.NumberFormat = "General"
.Value = Year(Date)
End With

Change A1 to the cell of interest.

---
Regards,
Norman



"Greg B" wrote in message
...
I am having problems working out a simple little sum. I have a userform
when I have a new member join I want it to add the current year. How can
I get excel to do this the easy way. I currently have it paste the now()
value and have set the cell to show yyyy but unfortuantely when I go to
the next cell where I want to have the worksheet work out the years member
section it comes up as volitile.

Any Ideas

Thanks

Greg







All times are GMT +1. The time now is 03:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com