Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I’ve been presented with a client designed workbook. Simply stated, the workbook contains a 2 column table, column 1 is the parameter name, column 2 is the parameter value. The parameter values control the program flow – the problem is the same parameter is used at different places in the code. The following is a dummied down sample to illustrate. Sub main() Call Sub1 If Param1 = "B" Then do something, else do nothing End Sub Sub Sub1() For x = 1 To 5 If Param1 = "A" Then do something, else do nothing Next x End Sub Of course, the simple example above can easily be handled with an IfThen statement. The real application is very complex, contains 40+ parameters in the table and each parameter has up to 4 different values. Sprinkling appropriate If/Then statements throughout the code would make any modification/maintenance a nightmare. I’m sure there is a more elegant solution, and I’m hoping someone can point me in the right direction. Any advice will be most appreciated. Thanks in advance. Regards, Dave U |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a VBA flow control statement that will ... | Excel Programming | |||
Flow of control from UserForm to Sheet1 sub | Excel Programming | |||
Flow of control in VBA Question - Userform Interaction | Excel Programming | |||
message box program flow | Excel Programming | |||
message box program flow | Excel Programming |