Need help with date problem.

  • Thread starter Thread starter Wiley in Norcal
  • Start date Start date
W

Wiley in Norcal

I have a date problem with an Excel user form that I would appreciate
some help with.

The user form is to input/save data to a spread sheet. It has various
controls all of which work ok except automatically inputing the date
that the record is created. The form has code that searches for a blank
row then saves the info.

I have tried =NOW() to generate the date which works but when I get it
into the form it has the formula which initially looks ok. However the
next time the spreadsheet is opened it is updated to the current date
rather than the record creation date. I also tried some date pickers
that kind of worked, but I wanted something as simple as possible. The
form is for a VERY new computer user with diabetes to record blood
sugar readings, notes, etc.

Any help appreciated as I am a hardware guy and am competely out of my
element.

Thanks,

Wiley
In HOT HOT Norcal
 
Use VBA to set the cell value to date and format it

e.g. Range("A1").Value = Format(Date,"dd mmm yyyy")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Assume rng is a reference to the cell wh ere you want the date

rng.Value = Now
or
rng.Value = date

Use date if you only want the month, day and year. If you want time as
well, use Now.

Using these VBA functions instead of putting a formula in the cell should
give you what you want.
 

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

Back
Top