+ Reply to Thread
Results 1 to 3 of 3

Pass cell content into a filter

  1. #1
    Registered User
    Join Date
    07-25-2007
    Location
    Singapore
    Posts
    11

    Pass cell content into a filter

    Hi all,

    I am doing a simple filter list copy and paste into another worksheet and I have a challenge trying to pass the value in Cell B1 (which contains the city) as a filter parameter in the filtered list.

    Is it possible for me to do something like that?

    Appreciate your help in advance! I have wrapped the code of my sub below.

    Cheers,
    Jerry

    Please Login or Register  to view this content.
    Last edited by jtan; 07-26-2009 at 09:30 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Pass cell content into a filter

    With this code,

    Please Login or Register  to view this content.
    you are placing the contents of a variable, B1, into another variable, FilterName.

    In your case B1 is a cell reference not a variable so must be treated as such.

    Please Login or Register  to view this content.
    You should also include a reference to the worksheet as part of that range, so change <sheetname> as appropriate.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-25-2007
    Location
    Singapore
    Posts
    11

    Re: Pass cell content into a filter

    Hi Andy,

    Appreciate lots on your help, it worked seamlessly. I came from a record-and-amend macro background and hence i am pretty helpless in this area.

    Thanks again for your help!

    Cheers,
    Jerry

    Quote Originally Posted by Andy Pope View Post
    With this code,

    Please Login or Register  to view this content.
    you are placing the contents of a variable, B1, into another variable, FilterName.

    In your case B1 is a cell reference not a variable so must be treated as such.

    Please Login or Register  to view this content.
    You should also include a reference to the worksheet as part of that range, so change <sheetname> as appropriate.

+ 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