Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
"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+;). |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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+;). |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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+;). |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I create a schedule from a list of dates ? | Charts and Charting in Excel | |||
Date to update after 7 days Please | Excel Worksheet Functions | |||
Need to Improve Code Copying/Pasting Between Workbooks | Excel Discussion (Misc queries) | |||
NETWORKDAYS - Multiple Date Selection | Excel Discussion (Misc queries) | |||
Automatic Date Update | Excel Discussion (Misc queries) |