Код |
---|
Sub iZadacha()
Dim i As Long
Dim iLastRow As Long
Dim iFoundZadacha As Range
Dim FAdr As String
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("K1:L" & iLastRow).Clear
Range("A2:A" & iLastRow).AdvancedFilter xlFilterCopy, CopyToRange:=Range("K1"), Unique:=True
For i = 2 To Cells(Rows.Count, "K").End(xlUp).Row
If Application.WorksheetFunction.CountIf(Range("A2:A" & iLastRow), Cells(i, "K")) > 1 Then
Set iFoundZadacha = Columns(1).Find(Cells(i, "K"), , xlFormulas, xlWhole)
FAdr = iFoundZadacha.Address
Do
Cells(i, "L") = Cells(i, "L") & iFoundZadacha.Row & ", "
Set iFoundZadacha = Columns(1).FindNext(iFoundZadacha)
Loop While iFoundZadacha.Address <> FAdr
End If
Next
End Sub
|
Макрос выводит в столбец К уникальные задачи, а в столбец L строки, где эти задачи совпадают.
Какие нормы правильные вам решать.