Switch Function Example

This example uses the Switch function to return the name of a language that matches the name of a city.

Function MatchUp (CityName As String)
    Matchup = Switch(CityName = "London", "English", CityName _
                    = "Rome", "Italian", CityName = "Paris", "French")
End Function