• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Şartlı Satır Silme

Katılım
5 Ocak 2021
Mesajlar
56
Excel Vers. ve Dili
2010 ve Türkçe
Arkadaşlar merhaba.

Excel dosyamda Veri Girişi sayfasının "A" sütununda bulunan isim listesinde (liste 4. satırdan başlıyor) aynı isimde olan satırlar var fakat aynı isimde olan satırların birinin sonunda "." (Nokta) var.

Örnek :
4. Satırda; "Kazım Kerem Korkmaz" yazıyor
5. Satırda; "Kazım Kerem Korkmaz." yazıyor

ismin sonunda nokta varsa o satır silmek için bir makroya ihtiyacım var.

Teşekkür ederim.
 
Deneyiniz.

C++:
Option Explicit

Sub Conditional_Delete_Rows()
    Dim Rng As Range, My_Area As Range
   
    With Sheets("Veri Girişi")
        For Each Rng In .Range("A4:A" & .Cells(.Rows.Count, "A").End(3).Row)
            If WorksheetFunction.CountIf(.Range("A:A"), Rng.Value & "*") > 1 Then
                If Right(Rng.Value, 1) = "." Then
                    If My_Area Is Nothing Then
                        Set My_Area = Rng
                    Else
                        Set My_Area = Union(My_Area, Rng)
                    End If
                End If
            End If
        Next
       
        If Not My_Area Is Nothing Then
            My_Area.EntireRow.Delete
            MsgBox "Tespit edilen satırlar silinmiştir."
        Else
            MsgBox "Uygun veri bulunamadı!", vbExclamation
        End If
    End With
End Sub
 
Deneyiniz.

C++:
Option Explicit

Sub Conditional_Delete_Rows()
    Dim Rng As Range, My_Area As Range
  
    With Sheets("Veri Girişi")
        For Each Rng In .Range("A4:A" & .Cells(.Rows.Count, "A").End(3).Row)
            If WorksheetFunction.CountIf(.Range("A:A"), Rng.Value & "*") > 1 Then
                If Right(Rng.Value, 1) = "." Then
                    If My_Area Is Nothing Then
                        Set My_Area = Rng
                    Else
                        Set My_Area = Union(My_Area, Rng)
                    End If
                End If
            End If
        Next
      
        If Not My_Area Is Nothing Then
            My_Area.EntireRow.Delete
            MsgBox "Tespit edilen satırlar silinmiştir."
        Else
            MsgBox "Uygun veri bulunamadı!", vbExclamation
        End If
    End With
End Sub

Allah razı olsun.
Tam istediğim gibi. Teşekkürler.
 
Geri
Üst