ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   date fields (https://www.excelbanter.com/excel-discussion-misc-queries/33255-date-fields.html)

coconutt

date fields
 
I am curious if their is a way to insert a date automatically in a field each
time the field is entered. ei. my A collum is a date collum and each line
needs a date.

Thanks

Bob Phillips

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Column = 1 Then
Target.Value = Format(Date, "dd mmm yyyy")
End If

End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

"coconutt" wrote in message
...
I am curious if their is a way to insert a date automatically in a field

each
time the field is entered. ei. my A collum is a date collum and each line
needs a date.

Thanks




DNA

I've had a lot of succes with this:

http://www.fontstuff.com/vba/vbatut07.htm

HTH



All times are GMT +1. The time now is 04:46 AM.

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