登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
Sub 风向风速()
Dim A(16, 7) As Integer
Dim I, J, X As Integer
X = Range("C1").End(xlDown).Row
For I = 2 To 17
For J = 2 To X
If Cells(I, 6) = Cells(J, 4) Then
If Cells(J, 3) < 30 Then
A(I - 2, 0) = A(I - 2, 0) + 1
ElseIf Cells(J, 3) < 65 Then
A(I - 2, 1) = A(I - 2, 1) + 1
ElseIf Cells(J, 3) < 100 Then
A(I - 2, 2) = A(I - 2, 2) + 1
ElseIf Cells(J, 3) < 130 Then
A(I - 2, 3) = A(I - 2, 3) + 1
ElseIf Cells(J, 3) < 150 Then
A(I - 2, 4) = A(I - 2, 4) +1
ElseIf Cells(J, 3) < 180 Then
A(I - 2, 5) = A(I - 2, 5) + 1
ElseIf Cells(J, 3) >= 180 Then
A(I - 2, 6) = A(I - 2, 6) + 1
End If
End If
Next J
Next I
For I = 2 To 17
Cells(I, 7) = A(I - 2, 0)
Cells(I, 8) = A(I - 2, 1)
Cells(I, 9) = A(I - 2, 2)
Cells(I, 10) =A(I - 2, 3) Cells(I, 11) =A(I - 2, 4) Cells(I, 12) =A(I - 2, 5) Cells(I, 13) =A(I - 2, 6) Next I
End Sub
|