نوشته اصلی توسط
davodabedzadeh
یه سوال دیگه شرمنده....چجوری فاصله بین چند تا ردیف رو تو ستون c از بین ببرم و اعداد پشت سر هم باشن....
این هم فایل بدون فاصله و تکرار
کد PHP:
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
علاقه مندی ها (Bookmarks)