سلام یه فایل پیوست کردم دو تا ستونa و b داره میخوام یه فرمول بنویسم که اعدادی ستون b رو بخونه ، اعدادی که در ستون a است را حذف کنه و در ستون c بنویسه
خواهش میکنم فوریه
حیاتیه
مرسی
خواهش میکنم فوریه
حیاتیه
مرسی
Sub TEST()
Dim I, J, T As Integer
Dim sht As Worksheet
Dim LastROWA, LastROWB As Integer
Set sht = ThisWorkbook.Worksheets("Sheet1")
LastROWA = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
LastROWB = sht.Cells(sht.Rows.Count, "B").End(xlUp).Row
T = 2
For J = 2 To LastROWB
For I = 2 To LastROWA
If Cells(I, 1).Value = Cells(J, 2).Value Then
Cells(T, 3).Value = Cells(I, 1).Value
If Cells(T, 3).Value = Cells(T - 1, 3).Value Then
Cells(T, 3).Value = ""
T = T - 1
End If
Cells(I, 1).Value = ""
T = T + 1
End If
Next I
Next J
End Sub
کامنت