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: 469
Default Trigger Question

column 12 triggers on 10 for one action and on <=0 for another. Is there a
way to have target trigger reduced to 10 when procedure for 10 runs.
Also if column 12 is left blank and row change is done can this be used for
trigger?
following is code I am useing for both triggers
Thanks in advance for any assistance this group is a Blessing to this old dog.


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo errhandler
Application.EnableEvents = False
If Target.Column = 12 And Target.Value 10 And
IsNumeric(Target.Value) Then _
Call CopyDonors(Target)
If Target.Column = (12) And Target.Value <= 0 Then _
Call Copycomp(Target)
Application.EnableEvents = True
Exit Sub
errhandler:
Application.EnableEvents = True
End Sub
Public Sub CopyDonors(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Donors")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(0, 0)
' recommend disabling events to block extra passes through
' Worksheet_Change caused for changing Donors cells
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(1, 0)
Range(Target.Offset(0, -7), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = Target - 10
Application.EnableEvents = True
End Sub
Public Sub Copycomp(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Comp")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(0, 0)
' recommend disabling events to block extra passes through
' Worksheet_Change caused by changing Comp cells
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(1, 0)
rngPaste = Range(Target.Offset(0, -7), Target.Offset(0, 0))
Range(Target.Offset(0, -7), Target.Offset(0, 0)).Copy _
Destination:=rngPaste
rngPaste.Offset(0, 7) = Target
Application.EnableEvents = True
End Sub


 
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
how to trigger data renegade Excel Worksheet Functions 6 January 22nd 10 11:08 PM
trigger help climax Excel Worksheet Functions 1 February 2nd 06 04:39 PM
Another way to trigger a macro? Leon[_5_] Excel Programming 1 December 22nd 05 06:03 AM
Trigger a sub when cell changes? No Name Excel Programming 1 October 7th 04 04:58 PM
Trigger Event Todd Huttenstine Excel Programming 2 July 14th 04 06:50 PM


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

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"