Alvaroro84
Board Regular
- Joined
- May 13, 2022
- Messages
- 65
- Office Version
- 2016
- Platform
- Windows
VBA Code:
Sub vlooupReclass()
With ActiveSheet
.Range("A1").AutoFilter 4, "0"
.AutoFilter.Range.Offset(1).Columns(4).FormulaR1C1 = "=VLOOKUP(RC[-3],[a]pivotable!R400000C3:R2C4,2,False)"
.Range("D2:D" & Cells(Rows.count, "D").End(xlUp).Row).SpecialCells (xlCellTypeVisible)
.Range("D" & Rows.count).End(xlUp).ClearContents
.AutoFilterMode = False
End With
With ActiveSheet
.Range("A1").AutoFilter 5, "0"
.AutoFilter.Range.Offset(1).Columns(5).FormulaR1C1 = "=VLOOKUP(RC[-4],[a]pivotable!R400000C3:R2C4,2,False)"
.Range("E2:E" & Cells(Rows.count, "E").End(xlUp).Row).SpecialCells (xlCellTypeVisible)
.Range("E" & Rows.count).End(xlUp).ClearContents
.AutoFilterMode = False
End With
With ActiveSheet
.Range("A1").AutoFilter 6, "0"
.AutoFilter.Range.Offset(1).Columns(6).FormulaR1C1 = "=VLOOKUP(RC[-5],[a]pivotable!R400000C3:R2C4,2,False)"
.Range("F2:F" & Cells(Rows.count, "F").End(xlUp).Row).SpecialCells (xlCellTypeVisible)
.Range("F" & Rows.count).End(xlUp).ClearContents
.AutoFilterMode = False
End With
End Sub