I'm looking to create my own case select function that behaves basically like the =IF built-in function but can be used without nesting. It's hard to come by detailed tutorials on function building, especially for what I'm trying to do since it's more complicated than calculating the area of a rectangle, for example.
The code below is what I have so far. I know it's not correct, but I don't know how to how to put it together. I'd like to have a larger set of optional arguments too, maybe 5 or 6.
Public Function CaseSelect(Case1 As Variant, Do1 As Variant, Optional Case2 As Variant, Optional Do2 As Variant)
Dim MyCase As Variant
Select Case MyCase
Case Case1
Do1
Case Case2
Do2
Case Else
End Select
End Function
Bookmarks