I have created a spreadsheet with a number of procedures that monitor parts of the spreadsheet for various activities and launch macros as needed. The trigger for some of these are the same--a change to the worksheet, although they refer to different parts of the worksheets.
Each procedures works fine on its own, but when I have multiple ones active, nothing happens for any of them. On one worksheet I have two Worksheet_Change procedures and on another worksheet I have three Worksheet_Change procedures.
Do these need to be combined into a single procedure watching the different parts of the worksheet? I've tried a bit of that, but haven't had any luck with that either--I'm not really a programmer but am quickly learning Excel
VB by being thrown into the fire! My code for one of the worksheets is below.
Any help you can provide would be greatly appreciated. Thanks!
Private Sub Worksheet_Change(ByVal Target As Range)
'Capture trigger (any change to cells that contain Expense Type drop-down list)
'Call macro to respond to changes to only those cells in the specified Range.
'Target is the current active cell (the one being changed).
Set isect_ExpType = Intersect(Range("A4:A60"), Target)
If isect_ExpType Is Nothing Then
Exit Sub
Else
Call ControlFlow
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'Capture trigger (any change to cells that contain Account Number)
'Call macro to respond to changes to only those cells in the specified Range.
'Target is the current active cell (the one being changed).
Set isect_Amt = Intersect(Range("I4:I60"), Target)
If isect_Amt Is Nothing Then
Exit Sub
Else
Call CreateSubtotal
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'If any change is made to the second page of the report,
'prompt user when they print. This sets the flag to know if anything
'on page 2 has changed.
Application.EnableEvents = False
MsgBox ("false = " & P2Changed) 'used for testing value of P2Changed
P2Changed = True
MsgBox ("true = " & P2Changed) 'used for testing value of P2Changed
Application.EnableEvents = True
End Sub