title: Loop through each visible worksheet and clear data found by filtering on a column
body: <p>My code is not looping through each worksheet which is not hidden. The desired result is for the code to loop through each worksheet which is visible and clear previous data found by filtering on column A with the variable <code>ProjectN</code>:</p>
  
  <pre><code>  Workbooks(pics).Activate
    Dim ws As Worksheet
    For Each ws In Workbooks(pics).Worksheets
    If ws.Visible = True Then
      If ActiveSheet.FilterMode Then
      Cells.AutoFilter
      End If
      Cells.AutoFilter Field:=1, Criteria1:=ProjectN
          If ActiveSheet.UsedRange.SpecialCells(xlCellTypeVisible).Rows.Count &gt;= 1 Then
          Range("A2:A100000").SpecialCells(xlCellTypeVisible).EntireRow.Delete
          End If
              If ActiveSheet.FilterMode Then
              Cells.AutoFilter
              End If
    End If
    Next ws
  </code></pre>
  
  <p>Can anyone could let me know why this is not working?    </p>