+ Reply to Thread
Results 1 to 3 of 3

advanced filter error 1004

  1. #1
    Tove
    Guest

    advanced filter error 1004

    Hey!
    I have made a macro with advanced filter. When I share this workbook i get a
    message:
    "advanced filter in range mode failed: error 1004" (something like that).
    The code is:
    Sub Idag()
    '
    Dim område As Range
    Dim kriterie As Range
    Dim dato As Range

    Set område = Range("Database")
    Set kriterie = Range("kriterie")
    Set dato = Range("A7")

    Application.ScreenUpdating = False
    Application.Goto Reference:=("Database")
    område.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
    kriterie, Unique:=False
    dato.Select

    End Sub

    Can anybody help!
    TD



  2. #2
    Tom Ogilvy
    Guest

    Re: advanced filter error 1004

    Using the data on the sheet when it fails, can you do it manually?

    Are all these ranges on the same sheet? Is the code in a general module?
    If the code is in a sheet module, then any range that is not in that should
    should be prefaces with a reference to the sheet where the range is located.
    For example, instead of Range("Database"), you would use
    worksheets("sheet2").Range("Database") if the code were in the code module
    for sheet1 and the range database is found on sheet2. Of course, if you
    are not executing this code as part of event code (and it appears you are
    not) it should be in a general/standard module rather than a sheet module.

    --
    Regards,
    Tom Ogilvy

    "Tove" <tovedit@online.no> wrote in message
    news:eXSzR1ZHFHA.1172@TK2MSFTNGP12.phx.gbl...
    > Hey!
    > I have made a macro with advanced filter. When I share this workbook i get

    a
    > message:
    > "advanced filter in range mode failed: error 1004" (something like that).
    > The code is:
    > Sub Idag()
    > '
    > Dim område As Range
    > Dim kriterie As Range
    > Dim dato As Range
    >
    > Set område = Range("Database")
    > Set kriterie = Range("kriterie")
    > Set dato = Range("A7")
    >
    > Application.ScreenUpdating = False
    > Application.Goto Reference:=("Database")
    > område.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
    > kriterie, Unique:=False
    > dato.Select
    >
    > End Sub
    >
    > Can anybody help!
    > TD
    >
    >




  3. #3
    Tove
    Guest

    Re: advanced filter error 1004

    I have 12 worksheets with database defined. Same macro on all sheets. Befor
    I share the workbook the macro is ok. When I share the workbook i get this
    message "...error 1004"
    "Tom Ogilvy" <twogilvy@msn.com> skrev i melding
    news:eVGII%23ZHFHA.400@TK2MSFTNGP14.phx.gbl...
    > Using the data on the sheet when it fails, can you do it manually?
    >
    > Are all these ranges on the same sheet? Is the code in a general module?
    > If the code is in a sheet module, then any range that is not in that
    > should
    > should be prefaces with a reference to the sheet where the range is
    > located.
    > For example, instead of Range("Database"), you would use
    > worksheets("sheet2").Range("Database") if the code were in the code
    > module
    > for sheet1 and the range database is found on sheet2. Of course, if you
    > are not executing this code as part of event code (and it appears you are
    > not) it should be in a general/standard module rather than a sheet module.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Tove" <tovedit@online.no> wrote in message
    > news:eXSzR1ZHFHA.1172@TK2MSFTNGP12.phx.gbl...
    >> Hey!
    >> I have made a macro with advanced filter. When I share this workbook i
    >> get

    > a
    >> message:
    >> "advanced filter in range mode failed: error 1004" (something like that).
    >> The code is:
    >> Sub Idag()
    >> '
    >> Dim område As Range
    >> Dim kriterie As Range
    >> Dim dato As Range
    >>
    >> Set område = Range("Database")
    >> Set kriterie = Range("kriterie")
    >> Set dato = Range("A7")
    >>
    >> Application.ScreenUpdating = False
    >> Application.Goto Reference:=("Database")
    >> område.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
    >> kriterie, Unique:=False
    >> dato.Select
    >>
    >> End Sub
    >>
    >> Can anybody help!
    >> TD
    >>
    >>

    >
    >




+ 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