+ Reply to Thread
Results 1 to 6 of 6

Trying to setup a filter based on Radio button Selection for the month

  1. #1
    Forum Contributor
    Join Date
    05-04-2012
    Location
    Stamford,Connecticut,USA
    MS-Off Ver
    Excel 2003
    Posts
    105

    Trying to setup a filter based on Radio button Selection for the month

    I have this file where there is a usage table and I want to create a filter on column D where the date is, based on the radio button selection for the month. The reason why is because at the end this is used to create a pdf file that contains the filtered section along with other sheets information (Not included) that is also built based on the radio and check buttons in the printing menu sheet. I have tried using the autofilter method to no avail for I have to pass the parameter from a different routine that identifies wich radio button was selected. My code is on sheet1.
    I tried passing this as the parameter but it doesnt work:

    Please Login or Register  to view this content.
    I then called the the "usage sub(strMth)" but it errors out.

    Please help
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Trying to setup a filter based on Radio button Selection for the month

    whats
    Worksheets("Usage Summary").Range("DateFltr").Select
    datafltr meant to grab?

    its pointing to ='Printing Menu'!$J$4 which is empty

    also usage summary doesnt not exist in your example
    only "usage"
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Trying to setup a filter based on Radio button Selection for the month

    i cant get your code to work either
    something to do with 1004 error

    I can get it to work without using strmth but i think that defeats the purpose of you doing it like this
    Please Login or Register  to view this content.
    as i dont understand your whole project look here for some reading
    http://www.excelforum.com/excel-prog...ss-failed.html

  4. #4
    Forum Contributor
    Join Date
    05-04-2012
    Location
    Stamford,Connecticut,USA
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Trying to setup a filter based on Radio button Selection for the month

    The file I sent is incomplete, as a whole the full version of the file is built to create a pdf file base on a few ranges in different worksheets. The code appears to be incomplete because of this reason, however, my challenge lies on the filtering section, that is why I did not elaborate on the rest. My goal is to create a filter based on the radio button, passing the filtering parameter from a different sub routine. The Range("DateFltr") is part of the full file version. I was trying to solve the 1004 error. Basically it refuses to set the filter on the cell where the data begins (In the full version is D13), so I tried to create a named range on D13, but it goes pass the instruction without error but the filter is not set. I tried to create a simplifited version of the file for those providing feed back (trying to eliminate "NOISE"). Back to my question: How do I set a dynamic autofilter passing the Month as the filtering parameter and the radio button as a trigger.
    I appreciate your help and anyone else willing to take a shot at this knowing that it generates error 1004

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Trying to setup a filter based on Radio button Selection for the month

    right did some playing around with it last night
    change strmth to dim as integer
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    you could try make the code with selecting but it works in its current form
    i think the issue was the strmth string combination

    go here for list of number for strmth
    http://msdn.microsoft.com/en-us/libr.../ff840134.aspx
    ie feb = 22 etc etc
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    05-04-2012
    Location
    Stamford,Connecticut,USA
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Trying to setup a filter based on Radio button Selection for the month

    Thanks, the msdn article is very valuable, I will use the value as an integer compared to the name as string.

+ 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