1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Sub Macro2()
Worksheets("flatfile").Select
i = 3
While Cells(i, 1) <> ""
Sheets("flatfile").Select
ActiveSheet.Range(Range("$A$2:$AD$2"), Selection.End(xlDown)).AutoFilter Field:=1, Criteria1:=Sheets("Mov flatfile").Cells(i, 1)
Worksheets("Mov flatfile").Select
If Cells(i, 16).EntireRow.Hidden = True Then
i = i + 1
Else
Cells(i, 38) = WorksheetFunction.VLookup(Cells(i, 16), Worksheets("flatfile").Range("M:AD").SpecialCells(xlCellTypeVisible), 18, False)
End If
i = i + 1
Wend
End Sub |
Partager