我试图在vba中运行一个For循环,以执行以下操作:
File "c:/Users/DavidDouglas/code/python/reversegeocode.py", line 13
for row in reader:
^
SyntaxError: invalid syntax
和Call Date_Back
)当前直到循环结束才粘贴数据,因此下一个空单元格始终为A2。
Call Backtest_Get_Data
Sub BackTester()
Dim i As Long
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim lstRow As Long
Set ws1 = Sheets("Sheet1")
Set ws2 = Sheets("Sheet2")
lstRow = ws2.Cells(Test.Rows.Count, 1).End(xlUp).Offset(1, 0).Row
For i = 0 To 5
Call Date_Back
Call Backtest_Get_Data
ws1.Range("B8", ws1.Range("B8").End(xlDown).End(xlToRight)).Copy
ws2.Range("A" & lstRow).PasteSpecial xlPasteValuesAndNumberFormats
Debug.Print ("A" & lstRow)
Next
在每个循环中均显示为Debug.Print(lstRow)
。