Varibles determine macro to run

D

Dennis Lavallee

I have searched the forum for a clue to answer my own question with n
luck.
I am a novices compared to all of you.

I have parts spareing work book that creates a recommended parts lis
that people need depending on how many units they support and th
model.

I wanted to be able to look at three fields on top level sheet and us
this to select a macro to filter my data sheet, by the inputs and the
print a report of the parts they need.
I have the calculations worked out for the numbers.

I have two control buttons that will determine the level of parts Basi
or ALL.
THis is a matrix for how I will filter based on the button selected an
the varibles I find in cells D8, D9 and D11.

Combinations for all inputs. Note numbers will be 0 or > 0 used 1 fo
simplicity.

D8 D9 D11 Detail Basic Run
1 0 0 1 0 Macro1
1 1 0 1 0 Macro2
1 0 1 1 0 Macro3
1 1 1 1 0 Macro4
0 1 0 1 0 Macro5
0 0 1 1 0 Macro6
0 1 1 1 0 Macro7
1 0 0 0 1 Macro8
1 1 0 0 1 Macro9
1 0 1 0 1 Macro10
1 1 1 0 1 Macro11
0 1 0 0 1 Macro12
0 0 1 0 1 Macro13
0 1 1 0 1 Macro14
* * * 0 0 ERROR
* * * 1 1 ERROR
0 0 0 * * ERROR

Thanks in advance for any thoughts
 
A

Ardus Petus

Sub Filter()
Select Case Evaluate("=A2&B2&C2&D2&E2")
Case "10010": Call macro1
Case "11010": Call macro2
Case "10110": Call macro3
Case "11111": Call macro4
Case "01010": Call macro5
Case "00110": Call macro6
Case "01110": Call macro7
Case "10000": Call macro8
Case "11001": Call macro9
Case "10101": Call macro10
Case "11101": Call macro11
Case "01001": Call macro12
Case "00101": Call macro13
Case "01101": Call macro14
Case Else: MsgBox "Invalid code"
End Select
End Sub

HTH
--
AP

"Dennis Lavallee"
<[email protected]> a écrit dans
le message de (e-mail address removed)...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top