Automatic Dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to have excel put a date in a cell whenever another cell is changed and then not change it again untill the the other cell is changed again

ITEM Amount in Truck Date Last Use

Water Pump 3 02/16/0

When AMOUNT IN TRUCK is changed i want the DATE LAST USED to give the current date. then not change untill AMOUNT IN TRUCK is changed again

I have reached the end of my skills. please help if possible. I can send actual copies of my current worksheet to anyone with an email address if desired. My email address is (e-mail address removed)
 
Russ

Right-click the sheet tab and "View Code". Copy/paste this code into the
blank sheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col B
On Error GoTo enditall
If Target.Cells.Column = 2 Then
n = Target.Row
If Excel.Range("B" & n).Value <> "" Then
Excel.Range("C" & n).Value = Now()
End If
End If
enditall:
End Sub

For more on Time and Date stamps see John McGimpsey's site.

http://www.mcgimpsey.com/excel/timestamp.html

Gord Dibben Excel MVP
 
Back
Top