עזרה עבור LibreOfficeDev 7.4
Evaluates a list of arguments, consisting of an expression followed by a value. The Switch function returns a value that is associated with the expression that is passed by this function.
Switch (Expression1, Value1[, Expression2, Value2[..., Expression_n, Value_n]]) As Variant
The \
\
\
In the following example, the \
Sub ExampleSwitch
Dim sGender As String
sGender = GetGenderIndex( "John" )
MsgBox sGender
End Sub
Function GetGenderIndex (sName As String) As String
GetGenderIndex = Switch(sName = "Jane", "female", sName = "John", "male")
End Function