Private Sub CommandButton1_Click()
Dim myRow , d, i As Integer
Sheets("final").Activate
With Sheets("final")
myRow = .Cells(1, 1).CurrentRegion.Rows.Count
d = 1
For i = 1 To myRow
If Range("V" & d).Value = ComboBox1.Value Then
Rows(d).Delete Shift:=xlUp
Else
d = d + 1
End If
Next i
End With
End Sub Next i
End With
[attach]15798[/attach]作者: a8350070 時間: 2013-8-18 08:56
本帖最後由 a8350070 於 2013-8-18 09:02 編輯
Private Sub CommandButton1_Click()
Dim myRow As Integer, d, i As Integer
'Sheets("final").Activate ' 不要這一行
With Sheets("final")
myRow = .Cells(1, 1).CurrentRegion.Rows.Count
d = 1
For i = 1 To myRow
If .Range("V" & d).Value = ComboBox1.Value Then '加一點
.Rows(d).Delete Shift:=xlUp '加一點
Else
d = d + 1
End If
Next i