Results 1 to 3 of 3

Delete Table Rows of filtered data - when some columns are hidden

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-08-2015
    Location
    North Carolina USA
    MS-Off Ver
    MS Office 2016
    Posts
    368

    Delete Table Rows of filtered data - when some columns are hidden

    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
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 10
    Last Post: 06-07-2018, 04:16 PM
  2. Replies: 4
    Last Post: 09-15-2016, 11:57 AM
  3. [SOLVED] Can you delete filtered rows in a table?
    By Butcher1 in forum Excel General
    Replies: 2
    Last Post: 02-25-2015, 01:01 PM
  4. Replies: 1
    Last Post: 04-08-2014, 02:50 AM
  5. Chart showing filtered rows bot not hidden columns?
    By D-smoke in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-01-2012, 05:53 AM
  6. copying filtered data WITH the hidden columns
    By noraaa in forum Excel General
    Replies: 2
    Last Post: 07-04-2012, 04:28 AM
  7. Replies: 4
    Last Post: 06-11-2010, 03:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1