Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Increment on when date happens in Excel?

Status
Not open for further replies.

neiljabba

IS-IT--Management
May 22, 2003
86
GB
I have a workbook that needs a value to change in a cell every literal year i.e. 365 days or on a specific date i.e. January 1st.

setting the value and incrementing it is not a problem, but how do I provide a solution to the date?

Is it possible to pull the system date and set it within code so if they are equal to make the change?

Is there an easier way?

Many thanks in advance.

Neil
 
not sure exactly what the question is here but you can use
=TODAY() in a formula or
Format(now(),"dd/mm/yyyy")
in code to get the current date - yuo can then compare that to a cell:

if format(now(),"dd/mm/yyyy")=format([A1],"dd/mm/yyyy") then
'do stuff
else
exit sub
end if

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Hi neiljabba,

I don't fully follow your question, but getting hold of the current date is easy enough - in a cell you can use [blue]=TODAY()[/blue], and in code the [blue]Date()[/blue] function.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top