![]() |
Date Update
I have a spreadsheet in which I type information after contacting a client.
Next to this cell I put the date that I contacted that client. I often have to contact the same client and overtype the information that was previously in that cell. Is there a way to automatically update the date after I overtype their information so that it shows when I last contacted that client? Any help would be appreciated. Thanks |
Date Update
"Nigel" wrote in message
... I have a spreadsheet in which I type information after contacting a client. Next to this cell I put the date that I contacted that client. I often have to contact the same client and overtype the information that was previously in that cell. Is there a way to automatically update the date after I overtype their information so that it shows when I last contacted that client? You could do this with some VBA code -- specifically an "event procedure". Rightclick the sheet tab and select "View Code" from the pop-up menu to access the VBA module for the sheet. Then paste this into the module: Private Sub Worksheet_Change(ByVal Target As Range) If Selection.Cells.Count < 1 Then Exit Sub If Target.Column = 1 Then Target.Offset(0, 1) = Date End If End Sub It assumes that the "info column" is A (Target.Column = 1) and the date column is B (Target.Offset(0, 1), i.e. one to the right), so change those to suit if necessary. Alternatively, you could just use the kb shrtcut for insert current date (CTRL+;). |
Date Update
You can do that with this Change event sub?
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 1 Then 'column of your client data, "A" in this example Cells(Target.Row, Target.Column + 1).Value = Date 'same row, next column End If End Sub Regards, Stefi €žNigel€ť ezt Ă*rta: I have a spreadsheet in which I type information after contacting a client. Next to this cell I put the date that I contacted that client. I often have to contact the same client and overtype the information that was previously in that cell. Is there a way to automatically update the date after I overtype their information so that it shows when I last contacted that client? Any help would be appreciated. Thanks |
Date Update
Thanks Andy, will give it a go!
"Andy Brown" wrote: "Nigel" wrote in message ... I have a spreadsheet in which I type information after contacting a client. Next to this cell I put the date that I contacted that client. I often have to contact the same client and overtype the information that was previously in that cell. Is there a way to automatically update the date after I overtype their information so that it shows when I last contacted that client? You could do this with some VBA code -- specifically an "event procedure". Rightclick the sheet tab and select "View Code" from the pop-up menu to access the VBA module for the sheet. Then paste this into the module: Private Sub Worksheet_Change(ByVal Target As Range) If Selection.Cells.Count < 1 Then Exit Sub If Target.Column = 1 Then Target.Offset(0, 1) = Date End If End Sub It assumes that the "info column" is A (Target.Column = 1) and the date column is B (Target.Offset(0, 1), i.e. one to the right), so change those to suit if necessary. Alternatively, you could just use the kb shrtcut for insert current date (CTRL+;). |
Date Update
Worked a treat, thanks!
"Andy Brown" wrote: "Nigel" wrote in message ... I have a spreadsheet in which I type information after contacting a client. Next to this cell I put the date that I contacted that client. I often have to contact the same client and overtype the information that was previously in that cell. Is there a way to automatically update the date after I overtype their information so that it shows when I last contacted that client? You could do this with some VBA code -- specifically an "event procedure". Rightclick the sheet tab and select "View Code" from the pop-up menu to access the VBA module for the sheet. Then paste this into the module: Private Sub Worksheet_Change(ByVal Target As Range) If Selection.Cells.Count < 1 Then Exit Sub If Target.Column = 1 Then Target.Offset(0, 1) = Date End If End Sub It assumes that the "info column" is A (Target.Column = 1) and the date column is B (Target.Offset(0, 1), i.e. one to the right), so change those to suit if necessary. Alternatively, you could just use the kb shrtcut for insert current date (CTRL+;). |
All times are GMT +1. The time now is 03:24 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com