Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Code - if T changed, change date in W to date it is changed

Hello!

I need code that if a value in T is changed, the date in
the corresponding row of W will change to the date it is
changed.

Any help I can get will be immensely appreciated!

Sandy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Code - if T changed, change date in W to date it is changed

Sandy,

Put the following code in the sheet module for the worksheet whose
changes you want to detect.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then
Exit Sub
End If
If Target.Column < 20 Then
Exit Sub
End If
Target(1, 4).Value = Now
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Sandy" wrote in message
...
Hello!

I need code that if a value in T is changed, the date in
the corresponding row of W will change to the date it is
changed.

Any help I can get will be immensely appreciated!

Sandy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Code - if T changed, change date in W to date it is changed

Dear Chip:

Thanks for your response. Works well, although I don't
understand exactly how it works. Could you briefly
describe what it's doing? I'm rusty in my VBA at the
moment.

Can this be taken one step further so that essentially,
clicking on the cell is not enough to change it, but the
actual change of the value will institute the date change?

Sandy

-----Original Message-----
Sandy,

Put the following code in the sheet module for the

worksheet whose
changes you want to detect.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then
Exit Sub
End If
If Target.Column < 20 Then
Exit Sub
End If
Target(1, 4).Value = Now
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Sandy" wrote in message
...
Hello!

I need code that if a value in T is changed, the date in
the corresponding row of W will change to the date it is
changed.

Any help I can get will be immensely appreciated!

Sandy



.

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
Can a cell be changed on a certain date Lou825 Excel Discussion (Misc queries) 2 January 31st 09 11:46 AM
My date formats changed Amin Excel Discussion (Misc queries) 3 January 25th 09 08:26 PM
Date suddenly changed Bjoern[_2_] New Users to Excel 4 June 12th 08 02:53 AM
if a1 value changed then date in b1 DKY Excel Worksheet Functions 5 July 13th 05 09:31 PM
How do I get a date changed automatically AmyR Excel Worksheet Functions 1 March 24th 05 01:19 PM


All times are GMT +1. The time now is 07:56 PM.

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

About Us

"It's about Microsoft Excel"