DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub AKTAR()
Dim S1 As Worksheet, S2 As Worksheet
Dim Son As Long, Veri As Range, Bul As Range
Dim Meyva As Variant, X As Byte, Satir As Long
Set S1 = Sheets("Report")
Set S2 = Sheets("Data")
S1.Range("B4:N" & Rows.Count).ClearContents
Son = S2.Cells(Rows.Count, 3).End(3).Row
Satir = 4
For Each Veri In S2.Range("C3:C" & Son)
Meyva = Split(Replace(Veri.Text, ", ", ","), ",")
For X = 0 To UBound(Meyva)
If WorksheetFunction.CountIf(S1.Range("B:B"), Meyva(X)) = 0 Then
S1.Cells(Satir, 2) = Meyva(X)
For Y = 3 To 15
If S1.Cells(3, Y) = Veri.Offset(0, -1) Then
S1.Cells(Satir, Y) = S1.Cells(Satir, Y) + 1
Exit For
End If
Next
Satir = Satir + 1
Else
Set Bul = S1.Range("B:B").Find(Meyva(X), , , xlWhole)
If Not Bul Is Nothing Then
For Y = 3 To 15
If S1.Cells(3, Y) = Veri.Offset(0, -1) Then
S1.Cells(Bul.Row, Y) = S1.Cells(Bul.Row, Y) + 1
Exit For
End If
Next
End If
End If
Next
Next
Set Bul = Nothing
Set S1 = Nothing
Set S2 = Nothing
MsgBox "Aktarım işlemi tamamlanmıştır.", vbInformation
End Sub