- Katılım
- 2 Ekim 2011
- Mesajlar
- 356
- Excel Vers. ve Dili
- excel 360 TR 64bit
merhaba A sütununda arayıp (A) hücrelerinde "istanbul" veya "ankara" metni olmayan hücrenin tüm satırını silmek istiyorum.bunu nasıl gerçekleştirebilirim
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub sil()
For a= [a65536].end(xlup).row to 2 step-1
If cells(a,1)<>"istanbul" and cells(a,1)<>"ankara" then
Cells(a,1).entirerow.delete
End if
Next a
End sub
A sütununda sadece şehir isimleri varsa;
Kod:Sub sil() For a= [a65536].end(xlup).row to 2 step-1 If cells(a,1)<>"istanbul" and cells(a,1)<>"ankara" then Cells(a,1).entirerow.delete End if Next a End sub
Kodlamasını kullanabilirsiniz.
Sub sil()
For a = [a65536].End(xlUp).Row To 2 Step -1
If Mid(Cells(a, 1), 1, 8) <> "istanbul" And Mid(Cells(a, 1), 1, 6) <> "ankara" Then
Cells(a, 1).EntireRow.Delete
End If
Next a
End Sub
Bu şekilde deneyiniz.
Kod:Sub sil() For a = [a65536].End(xlUp).Row To 2 Step -1 If Mid(Cells(a, 1), 1, 8) <> "istanbul" And Mid(Cells(a, 1), 1, 6) <> "ankara" Then Cells(a, 1).EntireRow.Delete End If Next a End Sub
Sub Sil()
For X = Cells(Rows.Count, 1).End(3).Row To 2 Step -1
Veri = UCase(Replace(Replace(Cells(X, 1), "ı", "I"), "i", "İ"))
If InStr(1, Veri, "İSTANBUL") = 0 And InStr(1, Veri, "ANKARA") = 0 Then
Cells(X, 1).EntireRow.Delete
End If
Next
MsgBox "İşleminiz tamamlanmıştır.", vbInformation
End Sub
çok teşekkürler hocam eline koluna sağlık çok işimi gördüSanırım büyük-küçük harf sorunu yaşıyorsunuz. Aşağıdaki gibi deneyin.
Kod:Sub Sil() For X = Cells(Rows.Count, 1).End(3).Row To 2 Step -1 Veri = UCase(Replace(Replace(Cells(X, 1), "ı", "I"), "i", "İ")) If InStr(1, Veri, "İSTANBUL") = 0 And InStr(1, Veri, "ANKARA") = 0 Then Cells(X, 1).EntireRow.Delete End If Next MsgBox "İşleminiz tamamlanmıştır.", vbInformation End Sub
İyi günler. bir listem var. Listedeki 2.sayfada bulunan listedeki isim ya da sicili sorgulayarak bulduğum kişinin bulunduğu satırı hem bu sayfada hemde 3. sayfada ve hatta oluşturacağım diğer sayfalarda silmek istiyorum. Hazır makro kullanınca sadece seçilmiş sıradaki satırı siliyor. oysa isimler farklı sıralarda olabiliyor. Bu konuda yardımcı olabilir misiniz?A sütununda sadece şehir isimleri varsa;
Kod:Sub sil() For a= [a65536].end(xlup).row to 2 step-1 If cells(a,1)<>"istanbul" and cells(a,1)<>"ankara" then Cells(a,1).entirerow.delete End if Next a End sub
Kodlamasını kullanabilirsiniz.