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
Microsoft OfficeMicrosoft ApplicationsMicrosoft Excel

Avatar of undefined
Last Comment
Patrick Matthews

8/22/2022 - Mon
Angelp1ay

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.
jmac001

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

Thanks
ASKER CERTIFIED SOLUTION
Patrick Matthews

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61