View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
bertbarndoor bertbarndoor is offline
external usenet poster
 
Posts: 7
Default VBA Autofilter -- what if criteria doesn't exist? Error handling??? Please help...

Hi, I'm asking excel to update an autofilter with the following line:

Selection.AutoFilter Field:=61, Criteria1:="2"

However, I just noticed that 2 is not always in the list. In that
case, it doesn't auto filter anything and all rows are still visible.
Is there a way that I can get it to display zero rows if it can't
autofilter by the desired criteria?

Thanks, Rob (bertbarndoor)