ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Record the date on which the record is made (https://www.excelbanter.com/excel-programming/365945-record-date-record-made.html)

cyberdude

Record the date on which the record is made
 
Hi,

I would like to input some data and the dates on which I input these
data in the adjacent cells on an Excel spreadsheet. An example is like
this one:

Data Dates on which I input the data
12 30-6-2006
13 30-6-2006
15 01-7-2006
17 02-7-2006

Could you tell me the way of doing this using VBA and the way using the
built-in functions of Excel? Thank you.

David


Harald Staff

Record the date on which the record is made
 
Hi David

Built-in functions cannot pust values to remote cells, you need VBA for
this. Rightclick sheet tab, choose View Code, paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cel As Range
For Each Cel In Target
If Cel.Column = 1 Then
Cel.Offset(0, 1).Value = Now 'or Date
End If
Next
End Sub

HTH. Best wishes Harald

"cyberdude" skrev i melding
oups.com...
Hi,

I would like to input some data and the dates on which I input these
data in the adjacent cells on an Excel spreadsheet. An example is like
this one:

Data Dates on which I input the data
12 30-6-2006
13 30-6-2006
15 01-7-2006
17 02-7-2006

Could you tell me the way of doing this using VBA and the way using the
built-in functions of Excel? Thank you.

David





All times are GMT +1. The time now is 01:32 AM.

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