Function zf配列を戻り値(ByVal dataStr As String) As Variant()
Dim returnArr() As Variant
Select Case dataStr
Case "あ"
returnArr() = Array("a", "i", "u")
Case "か"
returnArr() = Array("ka", "ki", "ku", "ke")
Case "さ"
returnArr() = Array("sa", "si", "su")
Case "た"
returnArr() = Array("ta", "ti", "tu", "te", , "to")
End Select
zf配列を戻り値 = returnArr()
End Function
Sub zf配列戻り値Sample()
Dim resArr As Variant
Dim s As String
Dim c As Long, i As Long
s = "か"
resArr = zf配列を戻り値(s)
For i = 1 To UBound(resArr)
Debug.Print resArr(i)
Next i
End Sub
コメント