Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, everyone -
I have a quick query that I was hoping to get some help with. I have created a rent comparability tool, for my employer, that uses the Auto-Filter to filter a database of housing unit information ("Comparability_Data") using 4 filter criteria, and shows the filtered results in Sheet1. I have included the code below: Private Sub CommandButton1_Click() 'Search for Comparable units' Dim str As String str = InputBox("Enter The CITY You Are Searching For:") Sheets("Comparability_Data").UsedRange.AutoFilter Field:=2, Criteria1:="=*" & str & "*", Operator:=xlAnd str = InputBox("Enter The UNIT TYPE You Are Searching For:") Sheets("Comparability_Data").UsedRange.AutoFilter Field:=3, Criteria1:="=*" & str & "*", Operator:=xlAnd cryMin = InputBox("Enter The MINIMUM BR SIZE Of Unit:") cryMax = InputBox("Enter The MAXIMUM BR SIZE Of Unit:") Sheets("Comparability_Data").UsedRange.AutoFilter Field:=8, Criteria1:="<=" & cryMax, Operator:=xlAnd, Criteria2:="=" & cryMin cryMin = InputBox("Enter The MINIMUM RENT AMOUNT You Are Searching For:") cryMax = InputBox("Enter The MAXIMUM RENT AMOUNT You Are Searching:") Sheets("Comparability_Data").UsedRange.AutoFilter Field:=6, Criteria1:="<=" & cryMax, Operator:=xlAnd, Criteria2:="=" & cryMin cryMin = InputBox("Enter The MINIMUM YEAR BUILT of Unit:") cryMax = InputBox("Enter The MAXIMUM YEAR BUILT Of Unit:") Sheets("Comparability_Data").UsedRange.AutoFilter Field:=9, Criteria1:="<=" & cryMax, Operator:=xlAnd, Criteria2:="=" & cryMin Sheets("sheet1").Range("A19:Ac39").Clear Sheets("Comparability_Data").Range("a1:I16").Speci alCells(xlCellTypeVisible).Copy Destination:=Sheets("sheet1").Range("a19") Unload UserForm2 Sheets("SHEET1").Range("A1").Select End Sub My question is how would I modify the code to identify the filter criteria used so that it would also appear on Sheet1? I was thinking, maybe, in the footer or somewhere else visible on Sheet1. Any help would be great --- Thanks!!! Golf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"search" a different sheet with multiple criteria | Excel Worksheet Functions | |||
How to show "yes" or "No" in a cell if certain criteria is met? | New Users to Excel | |||
Auto Filter - how to collapse "non-blank" cells in a column? | Excel Discussion (Misc queries) | |||
how to auto "copy & paste" (or filter) from a Master spreadsheet? | Excel Worksheet Functions | |||
Excel will not "show all" from an Advanced Filter on a sheet with protected cells. | Excel Programming |