- Katılım
- 31 Ağustos 2010
- Mesajlar
- 387
- Excel Vers. ve Dili
- Excel 2007-2010 Eng
Open Office Trk
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Selamlar burda yapmaya çalıştığım;
Kod ve no uyumu bozulmadan mükerrer olan kayılatların silinmem gerekiyor.
Bu konu ile ilgili bazı kodları denedim ama yapamadım.
Yardımlarınız için şimdiden teşekküler.
Sub mük_sil()
Dim a As Long
asi = MsgBox("Mükerrer Verileri Sileyim Mi_?", vbYesNo, "Onay")
If asi = vbNo Then Exit Sub
For a = 2 To Cells(65536, "A").End(xlUp).Row
Cells(a, "C") = Range("A" & a) & Range("B" & a)
Next
For sil = [C65536].End(3).Row To 1 Step -1
If WorksheetFunction.CountIf(Range("C2:C" & sil), Range("C" & sil)) > 1 Then Range("A" & sil & ":C" & sil).ClearContents
Next
Range("C2:C65536").ClearContents
Range("A2:B65536").Sort key1:=Range("A2"), ORDER1:=xlAscending
MsgBox "Mükerrer Veriler Silindi", vbInformation, "Bitiş"
End Sub
Hocam #3 nolu mesajıma örnek dosyayı ekledim. Teşekkürler.
Sub mük_sil()
Dim a As Long
asi = MsgBox("Mükerrer Verileri Sileyim Mi_?", vbYesNo, "Onay")
If asi = vbNo Then Exit Sub
For a = 2 To Cells(65536, "A").End(xlUp).Row
Cells(a, "E") = Range("A" & a) & Range("B" & a)
Next
For sil = [E65536].End(3).Row To 1 Step -1
If WorksheetFunction.CountIf(Range("E2:E" & sil), Range("E" & sil)) > 1 Then _
Range("A" & sil & ":E" & sil).ClearContents
Next
Range("E2:E65536").ClearContents
Range("A2:D65536").Sort key1:=Range("A2"), ORDER1:=xlAscending
MsgBox "Mükerrer Veriler Silindi", vbInformation, "Bitiş"
End Sub
Teşekkür ederim. Saygılar selamlar..
Sub BenzersizDuzenle()
Dim d, i As Long, j As Long, deg As String
Dim dizi() As String, x As Integer
Application.ScreenUpdating = False
Set d = CreateObject("Scripting.Dictionary")
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
deg = Cells(i, "A") & "|" & Cells(i, "B")
If Not d.exists(deg) Then
j = j + 1
ReDim Preserve dizi(1 To 4, 1 To j)
For x = 1 To 4
dizi(x, j) = Cells(i, x)
Next x
d.Add deg, Nothing
End If
Next i
Range("A2:D" & i).ClearContents
Range("A2").Resize(j, 4) = Application.WorksheetFunction.Transpose(dizi)
Application.ScreenUpdating = True
End Sub