ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Varibles determine macro to run (https://www.excelbanter.com/excel-programming/361856-varibles-determine-macro-run.html)

Dennis Lavallee

Varibles determine macro to run
 

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

--
Dennis Lavalle
-----------------------------------------------------------------------
Dennis Lavallee's Profile: http://www.excelforum.com/member.php...fo&userid=3457
View this thread: http://www.excelforum.com/showthread.php?threadid=54346


Ardus Petus

Varibles determine macro to run
 
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"
<Dennis.Lavallee.280rqn_1147983002.4768@excelfor um-nospam.com a écrit dans
le message de news:
...

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

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

I wanted to be able to look at three fields on top level sheet and use
this to select a macro to filter my data sheet, by the inputs and then
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 Basic
or ALL.
THis is a matrix for how I will filter based on the button selected and
the varibles I find in cells D8, D9 and D11.

Combinations for all inputs. Note numbers will be 0 or 0 used 1 for
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.


--
Dennis Lavallee
------------------------------------------------------------------------
Dennis Lavallee's Profile:
http://www.excelforum.com/member.php...o&userid=34572
View this thread: http://www.excelforum.com/showthread...hreadid=543463




Dennis Lavallee[_2_]

Varibles determine macro to run
 

Thanks, I'll try it today.

Again Thanks:

--
Dennis Lavalle
-----------------------------------------------------------------------
Dennis Lavallee's Profile: http://www.excelforum.com/member.php...fo&userid=3457
View this thread: http://www.excelforum.com/showthread.php?threadid=54346


Dennis Lavallee[_3_]

Varibles determine macro to run
 

Ardus, I thank you for getting me going works like a champ.

Thank

--
Dennis Lavalle
-----------------------------------------------------------------------
Dennis Lavallee's Profile: http://www.excelforum.com/member.php...fo&userid=3457
View this thread: http://www.excelforum.com/showthread.php?threadid=54346


Ardus Petus

Varibles determine macro to run
 
Thanks for the feedback!

Cheers,
--
AP

"Dennis Lavallee"
<Dennis.Lavallee.2825qn_1148047804.6819@excelfor um-nospam.com a écrit dans
le message de news:
...

Ardus, I thank you for getting me going works like a champ.

Thanks


--
Dennis Lavallee
------------------------------------------------------------------------
Dennis Lavallee's Profile:
http://www.excelforum.com/member.php...o&userid=34572
View this thread: http://www.excelforum.com/showthread...hreadid=543463





All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com