ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with date problem. (https://www.excelbanter.com/excel-programming/335585-need-help-date-problem.html)

Wiley in Norcal

Need help with date problem.
 
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


Bob Phillips[_6_]

Need help with date problem.
 
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)


"Wiley in Norcal" wrote in message
oups.com...
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




Tom Ogilvy

Need help with date problem.
 
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.

--
Regards,
Tom Ogilvy

"Wiley in Norcal" wrote in message
oups.com...
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





All times are GMT +1. The time now is 01:56 AM.

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