Link to home
Start Free TrialLog in
Avatar of jmac001
jmac001

asked on

Deleting rows in a table

Hello Experts,

I am trying to delete information in a table once it has been filtered.
All the visible information that appears in the table after it was filtered has to be deleted (except for the header).

I used the following code:
Sheets("Initiative Summary").ListObjects("InitiativeTbl").listColumns("Functional Area").databodyrange.specialcells(xlCellTypeVisible).Delete

The code works fine unless the first item in the table is invisible. In this case it deletes the entire table including the header.

Could you please help me fix this?

Thanks
Avatar of Angelp1ay
Angelp1ay
Flag of United Kingdom of Great Britain and Northern Ireland image

Does this have to be with VBA? Otherwise you can do this:
- Select the top left data cell to be deleted
- Hit Shift+Ctrl+Down
- Hit Ctrl+-
- Select entire row

You will then see the unfiltered results minus the rows you've just deleted.

Edit: To quickly get to the top left hit Ctrl+Up,Left (possibly a few times if you have empty cells) or alternatively Ctrl+Home but I typically find my hand over the arrow keys when I'm using Excel.
Avatar of jmac001
jmac001

ASKER

Angelp1ay, it has to be a macro to automatically perform these operations across multiple worksheets.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial