DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Sub Delete_Blank_Row()
Dim X As Long, Rng As Range
For X = 2 To Cells(Rows.Count, 1).End(3).Row
If WorksheetFunction.CountBlank(Range("A" & X & ":Z" & X)) > 5 Then
If Rng Is Nothing Then
Set Rng = Range("A" & X & ":Z" & X)
Else
Set Rng = Union(Rng, Range("A" & X & ":Z" & X))
End If
End If
Next
If Not Rng Is Nothing Then
Rng.Delete Shift:=xlUp
Set Rng = Nothing
MsgBox "5 boşluktan daha fazla boşluk içeren satırlar silinmiştir!", vbInformation
Else
MsgBox "5 boşluktan daha fazla boşluk içeren satır bulunumadı!", vbInformation
End If
End Sub
Teşekkür ederim ? Unutdum kusura bakmayın sadece boşluk değilde Nan olanlarida silsin istiyorum bunu nasıl yapabilirim?Merhaba,
Adres belirtmemişsiniz.
Aşağıdaki kod A-Z sütun aralığına bakar. 5 adetten fazla boş olan hücre varsa yine A-Z aralığını siler.
Not : Silme işlemi olduğu için verilerinizi yedekleyerek deneyiniz.
C++:Option Explicit Sub Delete_Blank_Row() Dim X As Long, Rng As Range For X = 2 To Cells(Rows.Count, 1).End(3).Row If WorksheetFunction.CountBlank(Range("A" & X & ":Z" & X)) > 5 Then If Rng Is Nothing Then Set Rng = Range("A" & X & ":Z" & X) Else Set Rng = Union(Rng, Range("A" & X & ":Z" & X)) End If End If Next If Not Rng Is Nothing Then Rng.Delete Shift:=xlUp Set Rng = Nothing MsgBox "5 boşluktan daha fazla boşluk içeren satırlar silinmiştir!", vbInformation Else MsgBox "5 boşluktan daha fazla boşluk içeren satır bulunumadı!", vbInformation End If End Sub
"Nan" nedir?
Görsel paylaşabilirmisiniz..