我创建了一个函数来接收三个参数。:
- 字符串数组
- 工作表名称
- 字符串数组的索引
当我编译时,我收到一个编译错误,说明:
编译错误:预期:=
我的电话是:
Sub C_Button_ImportBOM_Click()
Dim strFilePathName As String
Dim strFileLine As String
Dim v As Variant
Dim RowIndex As Long
Dim mySheet As Worksheet
ActiveSheet.Name = "Import"
mySheet = Worksheets("Import")
strFilePathName = ImportFilePicker
v = QuickRead(strFilePathName)
For RowIndex = 0 To UBound(v)
PopulateNewLine (v(RowIndex), mySheet, RowIndex)
Next
End Sub
函数声明为:
Function PopulateNewLine(SourceString As String, ImportSheet As Worksheet, CurrentRow As Long)
我尝试了很多事情都无济于事。最初只声明并使用了第一个参数,这可以正常工作。
任何想法都非常感谢。
Excel 2010 VBA