I am building a VBA search function across 3 product sheets (one at a time) for determining the next available size of packaging for a part (see attached example). Package chooser Rev5.xlsx
The search is based on 4 input criteria (length, width, height and mass) and returns the record containing the next largest dimensions across each of these values (being >= to the input values).
The combined part volume or aggregate measurements are not a decision criteria. The product sheets need to remain clean and be update-able by users.
I would like the output to be similar to this example https://www.youtube.com/watch?v=QOxhRSCfHaw ("Excel VBA Loop to Find Records Matching Search Criteria") where a matching row is copied and pasted to the search page.
I have setup a (non-VBA) drop-down combobox with a data validation list (Sheet Directory) for the the search page which should activate the chosen worksheet. (thus allowing users to add new product sheets without modifying VBA code).
I am unclear on the best way to manage this sheet activation in VBA and then the procedure for looping through the variables and only return records which meet all of the criteria at once. Any record containing any value not meeting the search condition would not be considered a match.
The inputs:
Length Width Height Mass
240, 33, 18, 160
Would match a row containing:
Length Width Height Mass
250.5, 35.40, 20, 187.44
But not be a match for:
Length Width Height Mass
250.5, 35.40, 20, 150
The procedure I have so far is possibly declaring a multidimensional array for the L,W,H,M column variables and creating a conditional operator of >= all "L,W,H,M" input values. Can I simplify things with a Select Case statement ? Or Select Case Is ?
Am I barking up the right tree?![]()
Please Login or Register to view this content.
Any help would be greatly appreciated!
Cross Posted Here:
http://www.mrexcel.com/forum/excel-q...lect-case.html
http://www.excelguru.ca/forums/showt...itional-values
http://www.vbaexpress.com/forum/show...th-Select-Case
Bookmarks