nirvehex
01-08-2020, 12:29 PM
Hi All,
I keep getting an error with this code:
Selection.AutoFilter
ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=20, Criteria1:= _
Array("CS", "DS", "L", "MN", "RR", "ROC"), Operator:=xlFilterValues
With Worksheets("Services").AutoFilter.Range
Range("Y" & .Offset(2, 0).SpecialCells(xlCellTypeVisible)(2).Row).Select
End With
With ActiveCell.FormulaR1C1 = _
"=VLOOKUP(CONCATENATE([@Location],""-"",[@ID]),Pivot!C:C[3],4,FALSE)"
Range("Y" & .Offset(2, 0).SpecialCells(xlCellTypeVisible)(2).Row).Select
End With
My table headers are in row 2 of my worksheet. Table = Table2. Worksheet = "Services".
All I'm trying to do is filter column T to specific values and then perform a Vlookup on the first visible cell below the header row in column Y and copy it down to the end of the table in that column. The first part works fine, but after that it errors out.
Any ideas?
Thank you!
*Cross Posted here: https://www.mrexcel.com/board/threads/help-debugging-short-vba-formula.1119906/
I keep getting an error with this code:
Selection.AutoFilter
ActiveSheet.ListObjects("Table2").Range.AutoFilter Field:=20, Criteria1:= _
Array("CS", "DS", "L", "MN", "RR", "ROC"), Operator:=xlFilterValues
With Worksheets("Services").AutoFilter.Range
Range("Y" & .Offset(2, 0).SpecialCells(xlCellTypeVisible)(2).Row).Select
End With
With ActiveCell.FormulaR1C1 = _
"=VLOOKUP(CONCATENATE([@Location],""-"",[@ID]),Pivot!C:C[3],4,FALSE)"
Range("Y" & .Offset(2, 0).SpecialCells(xlCellTypeVisible)(2).Row).Select
End With
My table headers are in row 2 of my worksheet. Table = Table2. Worksheet = "Services".
All I'm trying to do is filter column T to specific values and then perform a Vlookup on the first visible cell below the header row in column Y and copy it down to the end of the table in that column. The first part works fine, but after that it errors out.
Any ideas?
Thank you!
*Cross Posted here: https://www.mrexcel.com/board/threads/help-debugging-short-vba-formula.1119906/