+ Reply to Thread
Results 1 to 2 of 2

What is going on?

  1. #1
    Jennifer
    Guest

    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

  2. #2
    Jennifer
    Guest

    RE: 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


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1