LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Trigger a Date & Time stamp by entering data in another field...

Change this line
With Me.Cells(myRow, "d")
to use the correct column letter. I used D.

Dave Peterson wrote:

You can use an event macro.

Rightclick on the worksheet tab that should have this behavior. Select view
code and paste this into the code window that just opened.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Dim myRow As Long

If Target.Cells.Count 1 Then
Exit Sub 'one cell a time
End If

If Intersect(Target, Me.Range("a:a")) Is Nothing Then
Exit Sub 'Look in column A only
End If

myRow = Target.Row

On Error GoTo ErrHandler:
With Me.Cells(myRow, "d")
If IsEmpty(.Value) Then
'ok to add, the cell is empty
Application.EnableEvents = False
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
.Value = Now
End If
End With

ErrHandler:
Application.EnableEvents = True

End Sub

Then back to excel and type something into column A where column D is empty.

mjjohnso wrote:

Hello All,

I am currently building a spreadsheet with 6 simple column headings:

Employee
Inventory Number
Quantity
Production Unit
Date & Time
Comments

Problem: I would like to set up the €śDate & Time€ť column to where when any
data is entered into a field under the first column (Employee), the
corresponding field under the Date & Time column auto populates the current
date and time. (Obviously to minimize data entry for the employees)

One additional problem: Once that Date & Time field auto populates with the
current time it needs to remain with that time and not update.

Thank-you for any help.


--

Dave Peterson


--

Dave Peterson
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date & Time Stamp for printing Neon520 Excel Worksheet Functions 1 February 14th 08 02:39 AM
Date Time Stamp Dilemna [email protected] Excel Discussion (Misc queries) 9 November 1st 06 09:10 PM
Date-Time Stamp [email protected] Excel Discussion (Misc queries) 1 September 27th 06 02:37 PM
Time & Date Stamp 2 worksheets dot Excel Discussion (Misc queries) 2 September 11th 06 06:10 PM
date/time stamp Jan Excel Worksheet Functions 7 July 14th 05 01:04 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"