|
- Sub 按钮1_Click()
- Set d = CreateObject("scripting.dictionary")
- Application.ScreenUpdating = False
- For j = 2 To 11
- Select Case Cells(3, j).Value
- Case 0
- If d.exists("等于零") Then
- Set d("等于零") = Union(d("等于零"), Cells(5, j))
- Else
- Set d("等于零") = Cells(5, j)
- End If
- Case Is < 0
- If d.exists("小于零") Then
- Set d("小于零") = Union(d("小于零"), Cells(5, j))
- Else
- Set d("小于零") = Cells(5, j)
- End If
- Case Is > 0
- If d.exists("大于零") Then
- Set d("大于零") = Union(d("大于零"), Cells(5, j))
- Else
- Set d("大于零") = Cells(5, j)
- End If
- End Select
- Next j
- For j = 13 To 17 Step 2
- Cells(5, j) = WorksheetFunction.Min(d(Cells(3, j).Value))
- Cells(5, j + 1) = WorksheetFunction.Max(d(Cells(3, j).Value))
- Next j
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|