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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

time and date in vba

Status
Not open for further replies.

Epsilon101

Programmer
Mar 30, 2004
384
GB
Hi i was trying to find what i am after through the faqs, posts and google but nothing i have found explains what i am after.

I have 2 text boxes on a user form, i want to show in 1 todays date always in the format dd/mm/yyyy or dd/mmm/yyyy or whatever is best when you have computers with different language settings and you want the date to be inputted correctly, and the other textbox to display the time of the day in 24 hour.

So if i was doing it in worksheet cells im after the same thing as the functions:

=TODAY() for the date
=NOW() - TODAY() for the time

i am trying to put this in under userform_initialize, ive tried some variations and nothing has worked as yet, could someone shed some light on the correct way to do this, plz.. Thanks for any help

---------------------------------------

Neil
 
You may have better luck posting this in the VBA Visual Basic for Applications (Microsoft) Forum instead of the Office Forum.

Have a look at the Format VBA function, and using Now too.



Cheers, Glenn.

Alien Corn:
“My snorks got no dweezen.” “How does he froojle?” “Shalznik!”
 
My bad wasnt thinking ill post there and check out the format function.

---------------------------------------

Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top