【发布时间】:2015-08-04 16:47:29
【问题描述】:
以下代码的第一行出现语法错误。我正在使用array function parameters as shown in MSDN。 from String() 删除括号后,错误消失,但我需要一个字符串数组。 到目前为止我的代码:
Private Function Contains(name As String, names As String()) As Boolean
Contains = False
Dim Index As Integer
For Index = 0 To names.GetUpperBound(0)
If names(Index) = name Then
Contains = True
Exit For
End If
Next
End Function
【问题讨论】:
-
你的代码和MSDN文章里的代码不完全一样。
-
不完全相同,但在 MSDN 中他们使用 Private Sub ShowNumbers(numbers As Integer()) 并且在我的代码中它是 names As String()
标签: arrays excel vba function parameters