I did not grow up with SELECT statements, and they still seem foreign and cumbersome to me.
Nonetheless, that just means I need more practice.
Dick's example (the link above) is more practical than mine; I wanted to test the idea out with a simple string example, reproduced below.
Code: Select all
Function lngLivedThere(strIn As String) As Long
Select Case True
Case strIn = "WA", strIn = "SA", strIn = "NSW"
lngLivedThere = 1
Case Else
lngLivedThere = 0
End Select
'Sub TESTlngConciseCase()
' MsgBox lngLivedThere("WA")
' MsgBox lngLivedThere("SA")
' MsgBox lngLivedThere("NSW")
' MsgBox lngLivedThere("QLD")
'End Sub
End Function