当我在我的数据上使用此代码时,它不会为第1,2或6列生成数据。我有整个X,Y和Z列的值。我使用CountA来查找i的值,当前i = 803(对应于行X中的数据行数),但这需要是可变的(我计算这些简单变量的原因是在其他调用X,Y和Z值的代码中使用它们)对于每个i)。任何人都可以看到我的格式不正确吗?
Sub CalculateResults()
'Simple Worksheet Calculations
Dim Day As Variant
Dim DateTrue As Variant
Dim TF As Variant
For i = 0 To Cells(1, 1).Value
Day = Cells(3 + i, 1)
DateTrue = Cells(3 + i, 2)
X = Cells(3 + i, 3)
Y = Cells(3 + i, 4)
Z = Cells(3 + i, 5)
TF = Cells(3 + i, 6)
'Worksheet Calculations
Day = 0 + i
DateTrue = Application.WorksheetFunction.Min(Sheet2.Range("lookup_field[Field Start]")) + Day
TF = X + Y + Z
Next i
End Sub
非常感谢伙伴们。