Place Date in One column when entry is made in another column.

J

JT

Column J cells of my spreadsheet will contain cash contributions made by
certain individuals. When a dollar value is entered in cell J5, I would like
to have the date of the entry automatically entered in cell k5.

Am unable to figure our a function to handle this. Any help is appreciated.

JT
 
G

Gord Dibben

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 10 Then
n = Target.Row
If Me.Range("J" & n).Value <> "" Then
Me.Range("K" & n).Value = Format(Date, "mm-dd-yyyy")
End If
End If
enditall:
Application.EnableEvents = True
End Sub

This is sheet event ocde. Right-click on the sheet tab and "View Code"

Copy/paste into that sheet module.

Alt + q to return to Excel.


Gord Dibben MS Excel MVP
 
R

ryguy7272

Here's another option; right-click the tab and paste this code into the
window that opens:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("$A$1:$b$400")) Is Nothing Then
Application.EnableEvents = False
Application.ScreenUpdating = False
With Worksheets("Sheet2")
.Select
.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
ActiveCell.Value = Target.Address
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Target.Value
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = Now()
ActiveCell.NumberFormat = "mm/dd/yy"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = InputBox("You've made a change to the Rates tab.
Please enter your name here for historical purposes.")
Application.EnableEvents = True
Application.ScreenUpdating = True
End With
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top