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
This code works as i want it to work only issue is after it does the first column(column "D") it continues to open file explore over and over and doesn't move on to the next column in this case it doesn't move on to column E it gets stuck opening a ton of files explores. Is there a particular reason that its doing that and is there any way to get around it?