LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet Change Event

This is what I'm currently using: The event triggers whenever a value i
enter manually anywhere in column "b" and a timestamp is added in colum
z.

My goal is to trigger this event when "pasting a new value" in colum
"b".

See the code that follows this example. I accidentally found it in thi
forum and I'm hoping it could be modified by an expert to meet m
requirement. TIA everybody!

Private Sub Worksheet_Change(ByVal Target As Range)

If Intersect(Target, Me.Range("b:b")) Is Nothing Then Exit Sub
If Target.Cells.Count 1 Then Exit Sub

Application.EnableEvents = False

On Error GoTo errHandler:
With Target.Offset(0, 24)
.Value = Now 'date
.NumberFormat = "mm/dd/yyyy hh:mm"
End With

errHandler:
Application.EnableEvents = True
End Sub

The following code works "if" information is pasted in a range.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Dim changecolumn As Integer
Dim changerow As Integer
Dim changeworker As String

On Error GoTo errhandler:
Application.ScreenUpdating = False
Application.EnableEvents = False

For Each cell In Target
changecolumn = cell.Column
changerow = cell.Row
changeworker = 0
If changecolumn = 89 Then Exit For
Call change_flag(changerow, 1000, Me, changeworker)
Next

errhandler:
Application.EnableEvents = True
End Su

--
Message posted from http://www.ExcelForum.com

 
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
Worksheet Change event LAF Excel Discussion (Misc queries) 3 January 4th 06 02:08 AM
Worksheet Change Event TonyM Excel Discussion (Misc queries) 8 March 11th 05 12:52 PM
worksheet change event gautamvt Excel Programming 1 December 10th 03 05:15 PM
Worksheet change event Helen Trim[_3_] Excel Programming 0 September 23rd 03 03:00 PM
Worksheet Change Event Help Please J P Singh Excel Programming 1 July 16th 03 09:37 AM


All times are GMT +1. The time now is 02:07 AM.

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"