Thread: COUNTIF VBA
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Merritt Ave Merritt Ave is offline
external usenet poster
 
Posts: 3
Default COUNTIF VBA

On Friday, 4 March 2016 02:35:09 UTC-5, Claus Busch wrote:
Hi,

Am Thu, 3 Mar 2016 13:23:21 -0800 (PST) schrieb Merritt Ave:

Worksheets("Check").Range("A1").AutoFilter Field:=14, Criteria1:="MISC"
Application.DisplayAlerts = False
ActiveSheet.UsedRange.Offset(1, 0).Resize(ActiveSheet.UsedRange.Rows.Count - 1).Rows.Delete
Application.DisplayAlerts = True
ActiveSheet.ShowAllData


try it this way:

Worksheets("Check").Range("A1").AutoFilter Field:=14, Criteria1:="MISC"
Application.DisplayAlerts = False
ActiveSheet.Range("A2:A1000").SpecialCells(xlCellT ypeVisible).Delete
Application.DisplayAlerts = True
ActiveSheet.ShowAllData


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


Hi Claus - thanks for your response.
If I use your suggested method, it will give a VBA error when there is NOT an instance of the criteria search - NO CELLS WERE FOUND.