- Katılım
- 18 Ağustos 2007
- Mesajlar
- 22,183
- Excel Vers. ve Dili
- Microsoft 365 Tr
Ofis 2016 Tr
Module kopyalayıp çalıştırın.
Sonuçlar Sayfa3 de listelenir.
.
Sonuçlar Sayfa3 de listelenir.
Kod:
Sub Eslestir()
Dim S1 As Worksheet, sat As Long, i As Long, c As Range, Adr
Set S1 = Sheets("[COLOR=blue]Sayfa[/COLOR]1")
Application.ScreenUpdating = False
Sheets("[COLOR=red]Sayfa3[/COLOR]").Select
Range("A2:D" & Rows.Count).Clear
S1.Range("A:B").Copy Range("A1")
sat = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To S1.Cells(Rows.Count, "C").End(xlUp).Row
With S1.Range("B:B")
Set c = .Find(S1.Cells(i, "C"), , xlValues, xlWhole)
If Not c Is Nothing Then
Adr = c.Address
Do
Cells(c.Row, "C") = S1.Cells(i, "C")
Cells(c.Row, "D") = S1.Cells(i, "D")
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adr
Else
sat = sat + 1
Cells(sat, "C") = S1.Cells(i, "C")
Cells(sat, "D") = S1.Cells(i, "D")
End If
End With
Next i
End Sub
