ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Automatic Date and Times (https://www.excelbanter.com/excel-worksheet-functions/199042-automatic-date-times.html)

D. West

Automatic Date and Times
 
I would like to have the current date and time automatically populate in the
first column when anything else is entered on the same row. I am not
proficient with macros, etc., so I will need detailed info. Any help is
certainly appreciated!

Denise

Otto Moehrbach[_2_]

Automatic Date and Times
 
Denise
You would use a Worksheet_Change event macro. The possible problem is
that this macro will fire (execute) whenever ANY change is made to the
contents of ANY cell in the entire sheet. You can write code (the
instructions in the macro) to do some action only if the target cell (the
cell that changed) is within some range. Doing so will keep the date/time
from being inserted when you are doing things in some other part of the
sheet. Can you provide some details about the range in which you want this
to happen?
The macro would look something like the following. I chose A1:N100 as the
range you want. Note that such a macro MUST be placed in the sheet module
of the sheet in which you want this to happen. To access that module,
right-click the sheet tab, and select View Code. Paste this macro into that
module. "X" out of the module to return to your sheet. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1:N100")) Is Nothing Then
If IsEmpty(Target.Value) Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row, 1).Value = Now
Application.EnableEvents = True
End If
End Sub
"D. West" wrote in message
...
I would like to have the current date and time automatically populate in
the
first column when anything else is entered on the same row. I am not
proficient with macros, etc., so I will need detailed info. Any help is
certainly appreciated!

Denise



Gary Brown[_4_]

Automatic Date and Times
 
Assuming 'the first column' is Column A, You can use something like this.
=IF(COUNTA(B3:IV3)<0,NOW(),"")
Format Column A for your desired date/time format.
--
Hope this helps.
Thanks in advance for your feedback.
Gary Brown


"D. West" wrote:

I would like to have the current date and time automatically populate in the
first column when anything else is entered on the same row. I am not
proficient with macros, etc., so I will need detailed info. Any help is
certainly appreciated!

Denise



All times are GMT +1. The time now is 02:42 PM.

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