GRCArizona
Board Regular
- Joined
- Apr 24, 2010
- Messages
- 95
Hi -
Just upgraded from Excel 2013 to Excel 2016 and found an issue with a piece of code that worked fine in 2013 but is causing an error in 2016 on the 2nd row ".AutoFilter Field:=h, Criteria1....".
I've got code that filters a list for 2 criteria. The variables work fine as I've tested them and both "h" and "C" are working as expected.
Anybody come across this issue yet?
Thanks!
GRC
Just upgraded from Excel 2013 to Excel 2016 and found an issue with a piece of code that worked fine in 2013 but is causing an error in 2016 on the 2nd row ".AutoFilter Field:=h, Criteria1....".
I've got code that filters a list for 2 criteria. The variables work fine as I've tested them and both "h" and "C" are working as expected.
Anybody come across this issue yet?
Code:
With ActiveSheet.AutoFilter.Range
.AutoFilter Field:=h, Criteria1:=Sheets(strSheetName).Range("C" & s)
.AutoFilter Field:=4, Criteria1:="Active" '''OK
Set rngFiltCol = .Resize(.Rows.Count, 1).Cells.SpecialCells(xlCellTypeVisible)
If rngFiltCol.Cells.Count = 1 Then '
Else
Range("G9:AB" & p).Select '''OK
Selection.Copy '''OK
Sheets(strSheetName).Activate
Range("G" & Z).Select ''OK
Selection.PasteSpecial Paste:=xlPasteValues '''OK
End If
End With
[/FONT][/COLOR]
Thanks!
GRC