Sub summ()
Dim nrow As Integer
Dim nn As Integer
Dim i As Integer
Dim sumall As Single
Dim nplus As Integer
Dim sumplus As Single
Dim temp As Single
Dim st As Long
Dim en As Long
i = 2
temp = 0
st = Range(a2)
Do While Cells(i, 4) <>
If Cells(i, 4) = 买入 Then temp = temp - Cells(i, 5)
If Cells(i, 4) = 卖出 Then temp = temp + Cells(i, 5)
If (Cells(i, 4) = 买入) And (Cells(i + 1, 4) = 卖出) Then _
en = Range(a & (i + 1))
If (Cells(i, 4) = 卖出) And ((Cells(i + 1, 4) = 买入) _
Or (Cells(i + 1, 4) = )) Then
Cells(i, 10) = st & - & en
st = Range(a & (i + 1))
Cells(i, 11) = temp
temp = 0
End If
i = i + 1
Loop
nrow = Range(k65536).End(xlUp).Row
If (WorksheetFunction.Max(Range(k2, k & nrow)) > 0) Then
Range(m2) = WorksheetFunction.Max(Range(k2, k & nrow))
Else: Range(m2) = 0
End If
If (WorksheetFunction.Min(Range(k2, k & nrow)) < 0) Then
Range(m3) = WorksheetFunction.Min(Range(k2, k & nrow))
Else: Range(m2) = 0
End If
sumall = WorksheetFunction.Sum(Range(k2, k & nrow))
Range(m4) = sumall
nn = WorksheetFunction.CountA(Range(k2, k & nrow))
For i = 2 To nrow
If (Range(k & i) > 0) Then
nplus = nplus + 1
sumplus = sumplus + Range(k & i)
End If
Next i
Range(m5) = sumplus / nn
Range(m6) = (sumall - sumplus) / (nn - nplus)
Range(m7) = sumplus / nplus
End Sub
您好,您可通过我司金融终端、至诚版交易软件登录交易后,点击股票-查询-交割单菜单进行操作查询。
下一篇:个股分时图黄线和白线怎么设置?