Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Date update on data update

Hopefully, a relatively simple one to answer.

I have a worksheet where column D contains names (selected from a
combo box). I want the cell next to the name (ie column E same row)
to be updated with the current date only when the name is changed.
ie. If the name in D3 is changed the value in E3 becomes todays date.
I only want this though if the information in D3 is changed (ie I do
not want E3 altered if the name picked from the combobox is the same
as the one already in D3 - the names in the combobox are unique by the
way).

If somebody could advise with some code I would be very grateful.

Chris Thompson.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Date update on data update

Chris,

Here is a worksheet change event code. It goes into the worksheet module
(not a standard module)

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 Then
Cells(Target.Row, 5) = Date
End If
End Sub

You can restrict the rows by using
If Target.Row 2 Then
*above code*
End if

--
sb
"Chris Thompson" wrote in message
om...
Hopefully, a relatively simple one to answer.

I have a worksheet where column D contains names (selected from a
combo box). I want the cell next to the name (ie column E same row)
to be updated with the current date only when the name is changed.
ie. If the name in D3 is changed the value in E3 becomes todays date.
I only want this though if the information in D3 is changed (ie I do
not want E3 altered if the name picked from the combobox is the same
as the one already in D3 - the names in the combobox are unique by the
way).

If somebody could advise with some code I would be very grateful.

Chris Thompson.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Date update on data update

Hi Chris,
You can try the code below by right clicking on the worksheet name and
selecting "View Code" and pasting the following routine in. You can change
the Range to just D3 if that's all you need otherwise the code will work
from D3 to D100.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("D3:D100"), Target) Is Nothing Then
Cells(Target.Row, 5).Value = Date
End If
End Sub

Regards, Rocky McKinley

"Chris Thompson" wrote in message
om...
Hopefully, a relatively simple one to answer.

I have a worksheet where column D contains names (selected from a
combo box). I want the cell next to the name (ie column E same row)
to be updated with the current date only when the name is changed.
ie. If the name in D3 is changed the value in E3 becomes todays date.
I only want this though if the information in D3 is changed (ie I do
not want E3 altered if the name picked from the combobox is the same
as the one already in D3 - the names in the combobox are unique by the
way).

If somebody could advise with some code I would be very grateful.

Chris Thompson.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update one worksheet tab to automatically update all other tabs? shoechic1 Excel Worksheet Functions 1 May 24th 09 03:55 PM
Automatic Data Update by Date Range [email protected] Excel Worksheet Functions 1 October 1st 08 07:30 PM
Data Validation lists update orginal cell with list update [email protected] Excel Worksheet Functions 3 July 11th 08 07:56 AM
Update data by chaning date Slfbgv Excel Worksheet Functions 0 September 18th 07 05:50 PM
i want to update one excel file the other one update automaticaly Basant New Users to Excel 1 December 16th 06 12:50 AM


All times are GMT +1. The time now is 09:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"