inserting date on line

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,457
Office Version
  1. 2007
Platform
  1. Windows
hello,

please can you help?

i have a spreadsheet for entering parts ordered

simple list of parts, but would like a column to show the date ordered without entering it

i.e. when i open sheet and enter a line i would like the date to automatically appear in say column F (to save time)

but

it needs to save it as that date so next time i go into the sheet it still shows that day and not the new day until i enter a new line on that day

i was thinking along the lines of =now() but this only keeps the day that the shet is opened

hopefully i made this clear

any help would be appreciated

kind regards
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi Roy

Not exactly what you were after, but did you know that if you click Ctrl+; in a cell, then the date is automatically entered? It is a fixed value, so does not change unless you change the date.

Best regards

Richard
 

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,457
Office Version
  1. 2007
Platform
  1. Windows
yeah thats cool, but i was thinking of as many time saving ways as possible because i have so many values to enter i would like it to save the date without entering it (lazy eh?)

thanks anyway
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Ok, this is one way of doing it: you need to place the following code in the sheet module of the sheet that you enter the data into:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
    If Cells(Target.Row, "F") = "" Then Cells(Target.Row, "F").Value = Date
End If
End Sub

Basically, any time you enter a value or do anything to a column A cell, the macro will fire and will insert a date in the corresponding F cell but only if it is currently empty.

Richard
 

Forum statistics

Threads
1,136,352
Messages
5,675,269
Members
419,558
Latest member
Ryanms

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