ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   What is going on? (https://www.excelbanter.com/excel-programming/330592-what-going.html)

Jennifer

What is going on?
 
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
--
Though daily learning, I LOVE EXCEL!
Jennifer

Jennifer

What is going on?
 
Ok,
Never mind I figured it out.
I didn't enablevents at the end. Thanks Jennifer
--
Though daily learning, I LOVE EXCEL!
Jennifer


"Jennifer" wrote:

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
--
Though daily learning, I LOVE EXCEL!
Jennifer



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com