我在 excel 中获取特定股票的市场信息。所以我试图在另一个单元格中复制股票价格。因此,例如,X = 56 是 t1 时的股票价格。我在单元格中复制 56,例如 A50,下一次 t2 股票价格发生变化,我在单元格中复制,比如说 A 51,然后继续。我写了代码,但我得到了错误。
Sub CopyOpenItems()
Dim wbTarget
Dim wbThis
Dim WTF As Long
Dim FTW As Long
Dim X As Integer
X = 0
Set wbThis = ActiveWorkbook
Set wbTarget = ActiveWorkbook
ThisWorkbook.Sheets("Equity").Activate
FTW = Cells(151, "F").Value
WTF = Cells(X, "F").Value
Do While ActiveCell.Value <> ""
FTW = WTF
X = X + 1
Loop
End Sub