Hi,
I am trying to select and copy all rows on a worksheet (named Model) who's cell value in column "I" is greater than 0.00, and copy to a second worksheet called "Export"
This is how far I have got. I'm aware I think I currently have the filter criteria set to "=0", but using "<>" does not seem to work...
And when I currently run this, nothing gets copied onto the destination sheet even though all formulae in column I currently sum to 0...
Can anyone point me in the right direction please? Many thanks
-----------------------------------------------------------------------
Sub Extract()
Dim wsTO As Worksheet
Set wsTO = Sheets("Export")
With Worksheets("Model")
With .Range("I10:I" & .Cells(.Rows.Count, "I").End(xlUp).Row)
.AutoFilter field:=1, Criteria1:="0"
If Application.WorksheetFunction.Subtotal(103, .Columns(1)) > 1 Then .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).Copy Destination:=wsTO.Range("A1")
End With
.AutoFilterMode = False
End With
End Sub
I am trying to select and copy all rows on a worksheet (named Model) who's cell value in column "I" is greater than 0.00, and copy to a second worksheet called "Export"
This is how far I have got. I'm aware I think I currently have the filter criteria set to "=0", but using "<>" does not seem to work...
And when I currently run this, nothing gets copied onto the destination sheet even though all formulae in column I currently sum to 0...
Can anyone point me in the right direction please? Many thanks
-----------------------------------------------------------------------
Sub Extract()
Dim wsTO As Worksheet
Set wsTO = Sheets("Export")
With Worksheets("Model")
With .Range("I10:I" & .Cells(.Rows.Count, "I").End(xlUp).Row)
.AutoFilter field:=1, Criteria1:="0"
If Application.WorksheetFunction.Subtotal(103, .Columns(1)) > 1 Then .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).Copy Destination:=wsTO.Range("A1")
End With
.AutoFilterMode = False
End With
End Sub