Question about dates

Urlord

Board Regular
Joined
Aug 5, 2010
Messages
130
Is it possible to have a date entered automatically entered on a form created in Excel but prevent that date from changing the next day.
I have a spreadsheet to trace customer complaints and I would like the date to be automatically entered when the info is recorded but not change after the form is complete.

Thanks
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Yes it is possible using event code. In which range is the info entered and where should the date go?
 

desdd57

New Member
Joined
Oct 7, 2009
Messages
49
I have the same question, but would like to also relate that to time.

Des
 

Urlord

Board Regular
Joined
Aug 5, 2010
Messages
130

ADVERTISEMENT

Yes it is possible using event code. In which range is the info entered and where should the date go?

Not quite sure what you are asking but I will explain a much as I can
I have created a form ( Form 1 ) with cells that automatically updates cells in sheet 1. I would like a blank form to automaically have today's date entered into cell j5 ( I know you can use today() to accomplish this ) I would like lock this date into j5 once other fields have been filled out.

Hope this helps
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Do you mean a userform? If so what is the code used to populate Sheet1?
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
So it isn't a userform.

Which is the final cell that you complete on your 'form' and which cell in Sheet1 should contain the date?
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Right click the tab of your form, select View Code and paste into the white space on the right

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "B31" Then Sheets("Sheet1").Range("B3").Value = Date
End Sub

then press ALT + Q to close the code window.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,741
Messages
5,833,426
Members
430,207
Latest member
MedicineVan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top