Just trying to delete the red rows here... some columns are hidden though which I think is what is giving me the problem - due to the visible cells reference...
Id guess I just have to say visible cells, rows, but ive been trying for a while and am just not getting it haha...... what am I doing wrong here - see attached
Thank you for any help!
Here are 2 of the recent ones ive tried.. although theres been like 6-7 variations..
Sub ClearClosedFiles()
Dim wb As Workbook
Set wb = ThisWorkbook
With wb.ActiveSheet.ListObjects("Table_WorkloadTracking")
.Range.AutoFilter Field:=5, Criteria1:=RGB(192, 0, 0), Operator:=xlFilterCellColor
Rowz = .Range.Columns(2).SpecialCells(xlCellTypeVisible).Cells.Count - 1
If Rowz > 0 Then Range("Table_WorkloadTracking[FileNo]").Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.ShowAllData
End With
End Sub
Sub ClearClosedFiles2()
ActiveSheet.ListObjects("Table_WorkloadTracking").Range.AutoFilter Field:=5, Criteria1:=RGB(192, 0, 0), Operator:=xlFilterCellColor
Rowz = ActiveSheet.ListObjects("Table_WorkloadTracking").Range.Columns(5).SpecialCells(xlCellTypeVisible).Cells.Count - 1
If Rowz > 0 Then
rng = ActiveSheet.ListObjects("Table_WorkloadTracking").DataBodyRange.Address
ActiveSheet.Range(rng).SpecialCells(xlCellTypeVisible).EntireRow.Delete
End If
Range("Table_CollPreComplaint2[[#Headers],[FileNo]]").Select
ActiveSheet.ShowAllData
End Sub
Bookmarks