AD_Taylor
Well-known Member
- Joined
- May 19, 2011
- Messages
- 687
At the moment I have a set of code which needs to check conditions of 2 variables: trackerVers and addInVers.
Heres the code as it stands at the moment:
So you can understand that as more and more versions get added the code is going to get longer and longer.
I was wondering if it would be possible to restructure this into a Select Case statement so that it would be shorter and easier to read, but wasn't sure whether Select Case could handle the 'And' part?
Heres the code as it stands at the moment:
Code:
Sub UpdateTrackerVersion(trackerVers As Long, addInVers As Long)
'Master Sub that will call each individual update based on the version numbers it recieves
If trackerVers = 1 And addInVers = 2 Then
Call UpdateVersionMod.Update_201_To_202
ElseIf trackerVers = 2 And addInVers = 3 Then
Call UpdateVersionMod.Update_202_To_203
ElseIf trackerVers = 1 And addInVers = 3 Then
Call UpdateVersionMod.Update_201_To_203
End If
End Sub
So you can understand that as more and more versions get added the code is going to get longer and longer.
I was wondering if it would be possible to restructure this into a Select Case statement so that it would be shorter and easier to read, but wasn't sure whether Select Case could handle the 'And' part?