What is going on?

G

Guest

Can anyone give me any ideas why the first script is making the second not
work? The second runs fine until I run the first then the second no longer
works.
1st******
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit
Application.EnableEvents = False
If Target.Row = 3 And Target.Column = 3 Then
'calculate criteria cell in case calculation mode is manual
Worksheets("ProduceData").Range("s3").Calculate
Worksheets("ProduceData").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("ProduceData").Range("s2:s3"), _
CopyToRange:=Range("a7:g7"), Unique:=False
Me.Range("c4").ClearContents
End If
ws_exit:
Application.EnableEvents = True
End Sub

2nd******
Sub UpdateInvoiceList()
'
' UpdateInvoiceList Macro
' Macro created by 4/27/2005 by Jennifer S. Klever
With Worksheets("ProduceData")
Application.EnableEvents = False
..Range("Invoice").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range( _
"r2"), Unique:=True
..Range("InvoiceList").Sort Key1:=Sheets("ProduceData").Range("r3")
..Range("DatabaseSort").Sort Key1:=.Range("B1"), Order1:=xlAscending,
Key2:=.Range("C1"), Order2:=xlAscending, Header:=xlGuess
End With

Worksheets("Switchboard").Activate
End Sub
 
G

Guest

Ok,
Never mind I figured it out.
I didn't enablevents at the end. Thanks Jennifer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top