- Katılım
- 5 Eylül 2007
- Mesajlar
- 1,247
- Excel Vers. ve Dili
- ofis 2010
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
[B]Sub SATIR_SIL()[/B]
Set wf = Application.WorksheetFunction
Application.DisplayAlerts = False
For sat = 2 To Cells(Rows.Count, 1).End(3).Row
If Cells(sat, "F") > 0 And wf.CountIf(Range("G:G"), Cells(sat, "F")) > 0 Then
gsat = wf.Match(Cells(sat, "F"), Range("G:G"), 0)
Range("A" & sat & ":J" & sat).Delete Shift:=xlUp
[COLOR="Red"] If sat < gsat Then gsat = gsat - 1[/COLOR]
Range("A" & gsat & ":J" & gsat).Delete Shift:=xlUp
sat = sat - 1
End If
Next
Application.DisplayAlerts = True
MsgBox "İşlem tamamlandı.", vbInformation, "..::.. Ömer BARAN ..::.."
[B]End Sub[/B]
Merhaba.
Aşağıdaki gibi olur.
.Kod:[B]Sub SATIR_SIL()[/B] Set wf = Application.WorksheetFunction Application.DisplayAlerts = False For sat = 2 To Cells(Rows.Count, 1).End(3).Row If Cells(sat, "F") > 0 And wf.CountIf(Range("G:G"), Cells(sat, "F")) > 0 Then gsat = wf.Match(Cells(sat, "F"), Range("G:G"), 0) Range("A" & sat & ":J" & sat).Delete Shift:=xlUp Range("A" & gsat & ":J" & gsat).Delete Shift:=xlUp sat = sat - 1 End If Next Application.DisplayAlerts = True MsgBox "İşlem tamamlandı.", vbInformation, "..::.. Ömer BARAN ..::.." [B]End Sub[/B]
Merhaba.
Aşağıdaki gibi olur.
.Kod:[B]Sub SATIR_SIL()[/B] Set wf = Application.WorksheetFunction Application.DisplayAlerts = False For sat = 2 To Cells(Rows.Count, 1).End(3).Row If Cells(sat, "F") > 0 And wf.CountIf(Range("G:G"), Cells(sat, "F")) > 0 Then gsat = wf.Match(Cells(sat, "F"), Range("G:G"), 0) Range("A" & sat & ":J" & sat).Delete Shift:=xlUp Range("A" & gsat & ":J" & gsat).Delete Shift:=xlUp sat = sat - 1 End If Next Application.DisplayAlerts = True MsgBox "İşlem tamamlandı.", vbInformation, "..::.. Ömer BARAN ..::.." [B]End Sub[/B]
örnek dosyası ekledim, silmede hata yapıyor anlayamadım.
Önceki cevabımdaki kod'a bir satırlık ekleme (kırmızı renklendirdim) yaptım.
Sayfayı yenileyerek kod'un yeni haline bakın.
aşağıdaki satırı ilgili satırla değiştirin.
Kod:For sat = Cells(Rows.Count, 1).End(3).Row to 2 step -1