Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default I need a function that will trap & manage a change in cell value

Right click on the sheet tab and select View Code.
in the resulting module, paste in code like this:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Count 1 Then Exit Sub
On Error GoTo ErrHandler
' use your list of cells to react to
Set rng = Range("B1,C11,D12,M21,A5:A30,C1:C5")
If Not Intersect(Target, rng) Is Nothing Then
Application.EnableEvents = False
Target.Offset(0, 1).Value = Now
Target.Offset(0, 1).NumberFormat = "mm/dd/yyyy hh:mm"
Target.Offset(0, 1).EntireColumn.AutoFit
End If
ErrHandler:
Application.EnableEvents = True

End Sub

this uses the worksheet Change event. If you are not familiar with events,
see Chip Pearson's site
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Terry" wrote:

Scenario
A value exists in a cell
The value in the cell is changed by data entry
A date would be populated in an adjacent cell reflecting the date of change
- for that cell only
My worksheet has numerous places that this function would need to work

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
Creating an if then function to manage deductions from different c Michael Cook Excel Worksheet Functions 2 May 11th 09 09:42 PM
Foolproof way to trap Worksheet Change? Nick Excel Programming 5 September 19th 06 07:50 PM
How to manage/change the default month/day date format? Chuckie Excel Discussion (Misc queries) 2 July 13th 05 04:29 PM
Trap Sheet Name Change Otto Moehrbach[_6_] Excel Programming 6 October 25th 04 11:58 PM
How To Trap Cell Value Change Event so determine XL calc sequence? Alex Lai Excel Programming 3 June 30th 04 12:49 PM


All times are GMT +1. The time now is 11:25 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"