vzachin
01-30-2008, 12:31 PM
Hi,
I have the following code that does an autofilter in Column B and places the information into Column C but will give me an error message when the Criteria is blank. How can I bybass this error message?
I get a Run-time error '1004': No Cells were found.
iLastRow = Cells(Rows.Count, "B").End(xlUp).Row
Selection.AutoFilter Field:=2, Criteria1:="=*BROWN*", Operator:=xlAnd
Range("C5:C" & iLastRow & " ").SpecialCells(xlCellTypeVisible).Value = "BROWN"
thanks
zach
I have the following code that does an autofilter in Column B and places the information into Column C but will give me an error message when the Criteria is blank. How can I bybass this error message?
I get a Run-time error '1004': No Cells were found.
iLastRow = Cells(Rows.Count, "B").End(xlUp).Row
Selection.AutoFilter Field:=2, Criteria1:="=*BROWN*", Operator:=xlAnd
Range("C5:C" & iLastRow & " ").SpecialCells(xlCellTypeVisible).Value = "BROWN"
thanks
zach