- Katılım
- 19 Mayıs 2012
- Mesajlar
- 6
- Excel Vers. ve Dili
- office 2007
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Sub KOŞULLU_SATIR_SİL()
Dim X, Veri
Veri = Application.InputBox("Aradığınız değeri giriniz!")
If Veri = False Or Veri = "" Then Exit Sub
Application.ScreenUpdating = False
For X = Cells(Rows.Count, 1).End(3).Row To 2 Step -1
If WorksheetFunction.CountIf(Range("B" & X & ":E" & X), Veri) = 0 Then
Rows(X).Delete
End If
Next
Application.ScreenUpdating = True
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub
Merhaba,
Aşağıdaki kodu deneyiniz.
Kod:Option Explicit Sub KOŞULLU_SATIR_SİL() Dim X, Veri Veri = Application.InputBox("Aradığınız değeri giriniz!") If Veri = False Or Veri = "" Then Exit Sub Application.ScreenUpdating = False For X = Cells(Rows.Count, 1).End(3).Row To 2 Step -1 If WorksheetFunction.CountIf(Range("B" & X & ":E" & X), Veri) = 0 Then Rows(X).Delete End If Next Application.ScreenUpdating = True MsgBox "İşleminiz tamamlanmıştır.", vbInformation End Sub
Option Explicit
Sub KOŞULLU_SATIR_SİL()
Dim Veri As Variant, Alan As Range, Silinecek_Alan As Range, Satir As Long
Veri = Application.InputBox("Aradığınız değeri giriniz!")
If Veri = "" Then Exit Sub
Application.ScreenUpdating = False
For Each Alan In Selection
If Satir <> Alan.Row And Alan.Row > 1 Then
Satir = Alan.Row
If WorksheetFunction.CountIf(Alan.Resize(1, Selection.Columns.Count), Veri) = 0 Then
If Silinecek_Alan Is Nothing Then
Set Silinecek_Alan = Alan
Else
Set Silinecek_Alan = Application.Union(Silinecek_Alan, Alan)
End If
End If
End If
Next
Silinecek_Alan.EntireRow.Delete
Application.ScreenUpdating = True
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub