I'm trying to construct an IF statement on an autofilter.
Sub ExchangeCancels()
'Process Cancels
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=4, Criteria1:="=*exchange cancelled*", _
Operator:=xlAnd
'This doesn't seem to work If Selection.AutoFilter.Rows > 1 Then
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Exchange Cancels").Select
Range("A65536").Select
Selection.End(xlUp).Select
Selection.Offset(1, 0).Select
'.Range("A1").
ActiveSheet.Paste
End If
End Sub
I want to make an if statment telling to only do those actions if the autofilter returns a row of data (excluding the column titles). The is run on multiple worksheets. How would I go about doing this? Thanks!
This message was edited by JayLee on 2002-10-05 00:15
Sub ExchangeCancels()
'Process Cancels
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=4, Criteria1:="=*exchange cancelled*", _
Operator:=xlAnd
'This doesn't seem to work If Selection.AutoFilter.Rows > 1 Then
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Exchange Cancels").Select
Range("A65536").Select
Selection.End(xlUp).Select
Selection.Offset(1, 0).Select
'.Range("A1").
ActiveSheet.Paste
End If
End Sub
I want to make an if statment telling to only do those actions if the autofilter returns a row of data (excluding the column titles). The is run on multiple worksheets. How would I go about doing this? Thanks!
This message was edited by JayLee on 2002-10-05 00:15