Printing a fixed date next year

R

Robin Chapple

I need to print membership cards which show

"Valid to June (Next Year)" always.

I have adapted some earlier advice to build both of these options
which work but seem clumsy.

="Valid to June " & DatePart("yyyy",Date()+365)

="Valid to June " &
Year(Date())+(Date()<DateSerial(Year(Date()),7,2))+1

Is there an easier piece of code?

Thanks,

Robin Chapple
 
K

Ken Snell [MVP]

Easier? I leave that to you as a conclusion:


="Valid to June " & Year(Date()) - (Date() > DateSerial(Year(Date(), 7, 0))

or

="Valid to June " & Year(Date()) - (Month(Date()) > 6)
 
T

Tom Lake

I need to print membership cards which show
"Valid to June (Next Year)" always.

I have adapted some earlier advice to build both of these options
which work but seem clumsy.

="Valid to June " & DatePart("yyyy",Date()+365)

="Valid to June " &
Year(Date())+(Date()<DateSerial(Year(Date()),7,2))+1

Is there an easier piece of code?

Does this do it for you?

= "Valid to June " & Year(Date()) + 1

Tom Lake
 

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

Top