DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub sil()
For a = Cells(5, 256).End(xlToLeft).Column To 3 Step -1
say = WorksheetFunction.CountIf(Rows(5), Cells(5, a))
If say > 1 Then Columns(a).Delete
Next
End Sub
Function Benzersiz(Aralik As Range, i As Integer)
Application.Volatile
Dim ciftolmayan As New Collection
For Each ce In Aralik
On Error Resume Next
ciftolmayan.Add ce, CStr(ce)
Next ce
If i > ciftolmayan.Count Then
Benzersiz = ""
Else
Benzersiz = ciftolmayan(i)
End If
End Function
Alternatif
Bir modüle aşağıdaki kodları ekleyin.
Kod:Function Benzersiz(Aralik As Range, i As Integer) Application.Volatile Dim ciftolmayan As New Collection For Each ce In Aralik On Error Resume Next ciftolmayan.Add ce, CStr(ce) Next ce If i > ciftolmayan.Count Then Benzersiz = "" Else Benzersiz = ciftolmayan(i) End If End Function
C12 hücrenizede
=Benzersiz($C$5:$L$5;SÜTUN()-2) yazıp sağa doğru çekin.
Aşağıdaki kodu deneyin.
Kod:Sub sil() For a = Cells(5, 256).End(xlToLeft).Column To 3 Step -1 say = WorksheetFunction.CountIf(Rows(5), Cells(5, a)) If say > 1 Then Columns(a).Delete Next End Sub
Sub sil()
Application.ScreenUpdating = False
For b = 5 To [c65536].End(3).Row
For a = Cells(b, 256).End(xlToLeft).Column To 3 Step -1
say = WorksheetFunction.CountIf(Rows(b), Cells(b, a))
If say > 1 Then Cells(b, a).Delete Shift:=xlToLeft
Next
Next
End Sub
Aşağıdaki kodu deneyin.
Kod:Sub sil() Application.ScreenUpdating = False For b = 5 To [c65536].End(3).Row For a = Cells(b, 256).End(xlToLeft).Column To 3 Step -1 say = WorksheetFunction.CountIf(Rows(b), Cells(b, a)) If say > 1 Then Cells(b, a).Delete Shift:=xlToLeft Next Next End Sub
Bende denedim hata vermiyor. Örneğiniz ekte.
Sarı alandaki veriler sizin istediğiniz verilerdir.