fastballfreddy
Board Regular
- Joined
- Jan 13, 2015
- Messages
- 64
- Office Version
- 2016
- Platform
- Windows
I have a code that works but I'm repeating part of my code 3 times (Action 2 below in the code) and want to see if there is a way to only have it once. My current code uses - If, Else, If, ElseIf to process.
The 3 scenarios are the outcomes that could happen. Is there a way to always run Action 2 at the end without repeating it 3 times?
The 3 scenarios are the outcomes that could happen. Is there a way to always run Action 2 at the end without repeating it 3 times?
- Action 1 & Action 2
- Action 3, Action 4 & Action 2
- Action 3, Action 5 & Action 2
VBA Code:
Sub New Game()
IF CONDITION THEN
ACTION 1 & ACTION 2 (WOULD LIKE TO BE RAN AFTER EVERYTHING REGARDLESS)
ELSE ACTION 3
IF CONDITION THEN
ACTION 4 & ACTION 2 (WOULD LIKE TO BE RAN AFTER EVERYTHING REGARDLESS)
ELSEIF CONDITION THEN
ACTION 5 & ACTION 2 (WOULD LIKE TO BE RAN AFTER EVERYTHING REGARDLESS)
End If
End If
End If