LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Question on Input Boxes and Auto-Filter

Hi, everyone -

I am currently developing a Rent Comparability Tool that we can use at
work to compare market housing units to units that families are
proposing to rent on the Section 8 Voucher Program. One of the program
requirements is that an evaluation be made as to whether the rent a
landlord is proposing to charge a Section 8 family is comparable to
other similar "unassisted" rental units.

What we have now is about 9 binders full of statistics on unassisted
rentals such as where the rentals are located (cities), rent amounts,
bedroom sizes, utilities, etc. Part of the project is to create the
database with all of this stuff located on Sheet2 (called
"Comparability_Data"), which, for the most part, is done. Userforms
have already been built to enter future units into the database from
Sheet1. As well, a second userform has been built to do the actual
Search for comparables based on user input into the 6 Input Boxes
indicated in the code below via filtering Sheet2 to match the
unassisted units the proposed Section 8 unit. With some great
assistance from others, I've been able to come up with the code below
that seems to work fantastically.

This is my question/problem: the use of the Max and Min to have Staff
enter the rent range. I decided to broach the project with the boss
(don't kid yourself: suckin' up for brownie points), and she asked
whether there was a way to keep the Search ability (via filter), but
adjust the range slightly. What seems to be happening is, when I enter
500 for the Max Rent and 300 for the Min Rent, the filtered range from
my database is showing rent amounts from 301 through 499 --- logical,
yes; but I don't feel real comfortable that Staff can work with this.
Nor do I get a warm and fuzzy to have Staff remember to enter 501 as a
Max and 299 as a Min to get the "full" range of rents from 300 to 500.

I've tried to mess with the code strips to accomplish getting a FULL
range of rents, based on my filter criteria, but to no avail. I was
hoping that someone can give me a litle help in modifying my code:

Code:
__________________________________________________ _____________________

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

cryMax = InputBox("Enter The MAXIMUM BR SIZE Of Unit:")
cryMin = InputBox("Enter The MINIMUM BR SIZE Of Unit:")
Sheets("Comparability_Data").UsedRange.AutoFilter Field:=8,
Criteria1:="<" & cryMax, Operator:=xlAnd, Criteria2:="" & cryMin

cryMax = InputBox("Enter The MAXIMUM RENT AMOUNT You Are Searching
For:")
cryMin = InputBox("Enter The MINIMUM RENT AMOUNT You Are Searching
For:")
Sheets("Comparability_Data").UsedRange.AutoFilter Field:=6,
Criteria1:="<" & cryMax, Operator:=xlAnd, Criteria2:="" & cryMin

Sheets("sheet1").Columns("A:AB").Clear
Sheets("Comparability_Data").Range("a2:AB16").Spec ialCells(xlCellTypeVisible).Copy
Destination:=Sheets("sheet1").Range("a19")

End Sub
__________________________________________________ ____________________

I'll probably use the same assistance to modify the code strip for the
bedroom size as well.


Thanks for the help,
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Filter question bigguy68 Excel Discussion (Misc queries) 4 November 28th 07 04:16 PM
Auto Filter function only provide 2 criteria input Kent Excel Worksheet Functions 5 June 4th 07 04:17 PM
Auto-filter question Dallman Ross Excel Discussion (Misc queries) 21 November 23rd 06 03:45 PM
Auto Filter question Michael Raphael Excel Worksheet Functions 3 August 11th 06 04:28 PM
auto filter question scott23 Excel Programming 2 January 12th 04 03:40 PM


All times are GMT +1. The time now is 03:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"