+ Reply to Thread
Results 1 to 6 of 6

subscript out of range combo box auto filter selection

  1. #1
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    subscript out of range combo box auto filter selection

    Dear experts,
    I am working the following code. combobox1 has months jan~dec in it. combobox2 has years 2007~2009.upon selection change in combobox the auto filter should be applied according to given criteria in the code, but I am getting subscript out of range in final code line auto filter. Any idea?

    thanks

    Please Login or Register  to view this content.
    Last edited by shaukat; 12-17-2011 at 06:19 AM.

  2. #2
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: subscript out of range combo box auto filter selection

    Try referencing the sheet indstead og "Me.Listobjects"
    Please take time to read the forum rules

  3. #3
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: subscript out of range combo box auto filter selection

    Dear Steffen
    Thanks for your suggestion, I did it but same result. my sheet is attached.Please view it and give your advice

    thanks
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: subscript out of range combo box auto filter selection

    2 things

    Please Login or Register  to view this content.
    You need to change the format as seen here
    And secondly, your table is named "Table2" not "Table1"

    One last thing, i suggest you lock your comboboxes, else they will move with the autofilter

  5. #5
    Forum Contributor
    Join Date
    11-04-2011
    Location
    pak
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: subscript out of range combo box auto filter selection

    thanks for correcting me.You solved my case. One thing how to lock combobox.

  6. #6
    Valued Forum Contributor Steffen Thomsen's Avatar
    Join Date
    10-15-2010
    Location
    Kolding, Denmark
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    953

    Re: subscript out of range combo box auto filter selection

    Right click on the combobox while in design mode and then press "Format control", here you go to the tab "Properties" and select "Don't move or size with cells".

+ 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