Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro perhaps? Excel 2000 1

Status
Not open for further replies.

slirper

Technical User
Nov 28, 2000
59
GB
I need to achieve the following:

If I input data into one cell (usually numerical figures) I want the data in the adjacent cell to update automatically with the current DATE. It should only do this when the numerical data is changed and not when the file is opened.

Thanks for the help.
 
Enter the following code into the Worksheet object that contains the Input cells.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And IsNumeric(Target) Then
    Target.Offset(0, 1).Value = Format(Now(), "Short Date")
End If
End Sub

This code assumes that your input cells are in column A, if they are elsewhere you need to change the Target.Column = 1.

You can remove the InNumeric(Target) if it doesn't matter what is entered into the input cell.

I hope that this puts you on the right track.



If you can't be "The Best", be the best at what you can!!!

Never say Never!!!
Nothing is impossible!!!
 
You can also use this formular:

=IF(ISNUMBER(A1),NOW(),"Not Numeric")

I hope this hepls.

Mosmas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top