+ Reply to Thread
Results 1 to 7 of 7

how to change criteria Range become variabel in advanceFilter

  1. #1
    Registered User
    Join Date
    10-08-2011
    Location
    London, england
    MS-Off Ver
    Excel 2003
    Posts
    9

    how to change criteria Range become variabel in advanceFilter

    Excusme, I have problem with advanced filter to select data for 3 or more criteria. Generally the code use like this

    Please Login or Register  to view this content.
    But, How I can replace value CriteriaRange with my variable not use range like that. Because I use function to get result for criteria necessary but it's not work..

    So, within Cell K5 i'm write "=getAllData("MERAPI", "66", "living room", "2010") and code below is the function..

    Please Login or Register  to view this content.
    And the problem is "Range("A2").VALUE = " not contain "MERAPI"



    Thanks for your help..
    Last edited by romperstomper; 10-17-2011 at 06:21 AM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: [ask] how to change criteria Range become variabel in advanceFilter

    You cannot do that with a function in a cell, since they are not allowed to change other cells.

    Please note that I have altered your quote to code tags - please use those when posting code in future.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    10-08-2011
    Location
    London, england
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: how to change criteria Range become variabel in advanceFilter

    Oh, I'm Sorry.. I forget if must placed tags code before place my code.

    Thanks to remember..

    ======
    Thanks romperstomper to your reply..

    So, function can't do it to fill cell in worksheet like my code above ? Oh no, What must I do ? Do you have any idea for me please ?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: how to change criteria Range become variabel in advanceFilter

    You will have to use a subroutine.

  5. #5
    Registered User
    Join Date
    10-08-2011
    Location
    London, england
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: how to change criteria Range become variabel in advanceFilter

    Thanks for your reply. I have use sub procedure with function too, But still not works..

    wheter can't use function call sub routine to fill the cell ?

  6. #6
    Registered User
    Join Date
    10-08-2011
    Location
    London, england
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: how to change criteria Range become variabel in advanceFilter

    Thanks for your reply. I have use sub procedure with function too, But still not works..

    wheter can't use function call sub routine to fill the cell ?

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: how to change criteria Range become variabel in advanceFilter

    No you can't. You cannot do it from a function in a cell - only a sub (no matter whether you call the sub from the function)

+ 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