我想弄清楚爲什麼VBA
返回錯誤(Compile error: Expected: =)
當我呼籲Sub
並提供多個參數。任何幫助將不勝感激。VBA返回錯誤時調用多個參數的子
Sub customerController(cleanStructure As Boolean, firstCol As Integer, latCol As Integer, _
lngCol As Integer, Optional startRow As Long, Optional endRow As Long)
Dim i As Long, j As Long, n As Long
If (cleanStructure = False) Then
'customer data type
If (startRow = "") Then i = 1
If (endRow = "") Then j = countRows
For n = i To j - i + 1
generateURL(n, firstCol)
newReadXMLData (url)
ActiveSheet.Cells(i, latCol).Value = lat
ActiveSheet.Cells(i, lngCol).Value = lng
Next
End If
End Sub
那我打電話Sub
需要兩個參數:
Sub generateURL(row As Long, column As Long)
你可以發佈如何調用它的代碼嗎?您已發佈customerController,但是指的是readAddress? – InContext
糟糕,我在最後一行發佈了錯誤的函數。 我在'generateURL(n,firstcol)'行中得到錯誤。 – MartinUKPL
將'generateURL(n,firstCol)'更改爲'generateURL n,firstCol' –