JeffGrant
Well-known Member
- Joined
- Apr 7, 2021
- Messages
- 519
- Office Version
- 365
- Platform
- Windows
Hi All,
I have a vba module that looks like this without the actual test conditions & code. This is the actual module with 17 elseif's, and several sub-if's. Each of these conditions are independant and are being tested for separately.
With Sheet1
If Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Or Or Or Then
If And Then
End If
If And Then
End If
If Then
End If
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
If Then
End If
ElseIf Then
End If
End With
I have looked at the arguments for and against multiple ElseIf's and Case, and it just seems to come down to personal preference. Given the spagetti code structures above, does anybody have an option on what would be a better way to test all these scenrios to give me better performance from the PC?
chat soon.
Jeff.
I have a vba module that looks like this without the actual test conditions & code. This is the actual module with 17 elseif's, and several sub-if's. Each of these conditions are independant and are being tested for separately.
With Sheet1
If Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Or Or Or Then
If And Then
End If
If And Then
End If
If Then
End If
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
ElseIf Then
If Then
End If
ElseIf Then
End If
End With
I have looked at the arguments for and against multiple ElseIf's and Case, and it just seems to come down to personal preference. Given the spagetti code structures above, does anybody have an option on what would be a better way to test all these scenrios to give me better performance from the PC?
chat soon.
Jeff.