First, the VBA code:
Expand|Select|Wrap|Line Numbers
- Set rData = wsData.Range("BQ5", wsData.Range("BQ65536").End(xlUp))
- Set rTargetCl = wsTarget.Range("B65536").End(xlUp).Offset(1,0)
- With rData
- .AutoFilter Field:=1, Criteria:=">0", Operator:=xlAnd
- rData.Offset(1,0).SpecialCells(xlCellTypeVisible).Copy Destination:=rTargetCl
- .AutoFilter
- End With
Expand|Select|Wrap|Line Numbers
- rData = (Excel.Range)wsData.get_Range("BQ5", wsData.get_Range("BQ65536", Type.Missing).get_End(Excel.xlDirection.xlUp));
- rTargetCl = (Excel.Range)wsTarget.get_Range("B65536", Type.Missing).get_End(Excel.xlDirection.xlUp).get_Offset(1,0);
- // I get the error on this line
- ((Excel.Range)rData.AutoFilter(1,">0",Excel.xlAutoFilterOperator.xlAnd, Type.Missing, Type.Missing)).get_Offset(1,0).SpecialCells(Excel.xlCellType.xlCellTypeVisible, Type.Missing).Copy(rTargetCl);
Any help would be greatly appreciated.