+ Reply to Thread
Results 1 to 5 of 5

Advance filter with Application.InputBox to set CriteriaRange

  1. #1
    Registered User
    Join Date
    01-05-2010
    Location
    Ljubljana
    MS-Off Ver
    Excel 2002
    Posts
    3

    Advance filter with Application.InputBox to set CriteriaRange

    Hi
    I am a beginner in VBA and would appreciate some help with this.
    I get run time error 1004 method range of object global failed.

    I would like to use prompt box to select criteria range.

    Please Login or Register  to view this content.

    Thanks!

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,327

    Re: Advance filter with Application.InputBox to set CriteriaRange

    MyRange is a Range object, so you don't use Range(MyRange):
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    01-05-2010
    Location
    Ljubljana
    MS-Off Ver
    Excel 2002
    Posts
    3

    Re: Advance filter with Application.InputBox to set CriteriaRange

    I did try that and still get 1004 error.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,327

    Re: Advance filter with Application.InputBox to set CriteriaRange

    Assuming you selected at least two rows, and a valid criteria range, the code needs a small alteration anyway in case of not selecting anything:
    Please Login or Register  to view this content.
    If that still doesn't work, I'd need a sample workbook.

  5. #5
    Registered User
    Join Date
    01-05-2010
    Location
    Ljubljana
    MS-Off Ver
    Excel 2002
    Posts
    3

    Re: Advance filter with Application.InputBox to set CriteriaRange

    Thanks for your help!

    Code is OK, it turns out that I am blind as PB col is out of worksheet range.
    My apologies!
    Last edited by logo; 01-05-2010 at 10:45 AM.

+ 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