Впервые в VBA, пришедшей из Python, так что это различие.
Sub Average_Income()
Dim data As Worksheet
Dim avg As Worksheet
Dim i As Long
Dim Total As Long
Dim Bottom As Long
Dim Low As Long
Dim Mid As Long
Dim Mid_High As Long
Dim High As Long
Dim Top As Long
Dim Number As Long
Set data = ActiveWorkbook.Sheets("Data")
Set avg = ActiveWorkbook.Sheets("Averages")
Total = CLng(7)
Bottom = CLng(8)
Low = CLng(9)
Mid = CLng(10)
Mid_High = CLng(11)
High = CLng(12)
Top = CLng(13)
For i = 2 To 1000
Number = avg.Cells(i, 2)
CLng(Number) = CLng(data.Cells(Total, 19).Value) / CLng(data.Cells(Total, 18).Value)
Total = Total + 8
Next i
End Sub
Я чувствую, что перепробовал все!Что происходит?