Filter from the nine columns

adamsm

Active Member
Joined
Apr 20, 2010
Messages
444
Hi,

How can I make the following code so that it filters the sheet from column 1 to column 9. At present it filters the sheet only from column 3.

Any help on this would be kindly appreciated.

Code:
<code>Set mylist = ActiveSheet.ListObjects
     If mylist.Count Then ' A List or Table Object is used
            tblname = mylist(1).Name
        
        If Cells(rownum, colnum).Value = "" Then ' No filter choice
             mylist(tblname).Range.AutoFilter Field:=3
             GoTo cleanup
        ElseIf caret Then
            mylist(tblname).Range.AutoFilter Field:=3, _
            Criteria1:=crit1, Operator:=optype, Criteria2:=crit2
            GoTo cleanup
        Else
            mylist(tblname).Range.AutoFilter Field:=3, _</code>
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,216,102
Messages
6,128,849
Members
449,471
Latest member
lachbee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top