|
多加了个条件 Cells(i, 2).Value <> "中国农业银行002"
把代码换成下面的就可以了
'------------------------------------------------------------------------------------------------------------------
Private Sub CommandButton1_Click()
ActiveSheet.Columns("M:o").Clear
Dim i, Maxrow, a
Maxrow = ActiveSheet.[A65536].End(xlUp).Row
arr1 = Range("A2:c" & Maxrow)
a = 2
For i = 2 To UBound(arr1, 1)
If (Cells(i, 3).Value >= 10000 Or Cells(i, 3).Value < 0) And Cells(i, 2).Value <> "中国农业银行002" Then
Sheets("数据").[m1:O1] = Array("日期", "银行名称", "金额")
Sheets("数据").Cells(a, 13) = Sheets("数据").Cells(i, 1).Text
Sheets("数据").Cells(a, 14) = Sheets("数据").Cells(i, 2)
Sheets("数据").Cells(a, 15) = Sheets("数据").Cells(i, 3).Value
a = a + 1
End If
Next i
[M1].CurrentRegion.Sort Key1:=Range("M2"), Order1:=xlAscending, Header:=xlGuess
[N1].CurrentRegion.Sort Key1:=Range("N2"), Order2:=xlAscending, Header:=xlGuess
End Sub
|
|