Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I code a button to filter on worksheet2
I have created a button on worksheet1 and I need code that will allow me
to run my filter for sheet2. I already have the filter code, but I need code that will focus or run the filter for sheet2. here is the code I am using that will run the filter it will work if I do it in sheet1 but I have to open the file in sheet2 because it is a dbf file and because of the buttons and so forth: Dim iLastRow As Long iLastRow = Cells(Rows.Count, "B").End(xlUp).Row With Range("B1:B" & iLastRow) .AutoFilter Field:=1, Criteria1:="SC" .SpecialCells(xlCellTypeVisible).EntireRow.Copy _ Destination:=Worksheets("Sheet2").Range("A1") .AutoFilter .AutoFilter Field:=1, Criteria1:="SU" .SpecialCells(xlCellTypeVisible).EntireRow.Copy _ Destination:=Worksheets("Sheet3").Range("A1") .AutoFilter End With Thanks again to all that have helped out. *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to set a button to filter a table | Charts and Charting in Excel | |||
How do I make worksheet2 = to worksheet1? | Excel Discussion (Misc queries) | |||
Filter - Show All button | Excel Discussion (Misc queries) | |||
change position of filter button | Excel Worksheet Functions | |||
columns on worksheet2 don't sort with worksheet1 | Excel Worksheet Functions |