Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete a row in a filtered table - next to another table

Status
Not open for further replies.

MattGreer

Technical User
Feb 19, 2004
471
US
One annoyance for me is not being able to delete a table row when the table is filtered and there's another table occupying the same row on that same worksheet. So I was going to write a macro to do this for me.

I searched the internet and couldn't find another solution so of course I came here as y'all are fantastic and have helped me, gosh, going back to 2002 (I had a different account way back then). I digress.

Thinking out loud, my proposed solution would be:

[ul]
[li]Make note of the row(s) (by row number) that are selected to be deleted.[/li]
[li]Make note of the filter that is currently applied.[/li]
[li]Unfilter the table.[/li]
[li]Delete the rows in the table.[/li]
[li]Re-filter the table.[/li]
[li]Set the active cell to be on the next row after the ones that were deleted. (I guess a user preference...)[/li]
[/ul]

So questions:
[ol 1]
[li]Does Excel have something built-in that does this automatically already?[/li]
[li]Do any of y'all already have something written that does this? If so would you share it?[/li]
[li]If no one has anything existing, does this sound like an appropriate method? If not, what would you change?[/li]
[/ol]


Thanks!!


Matt
 
If I understand what you are trying to do, I think you may be over complicating this.

First apply your filter.

Now select the cells that you want to delete.

Right click on the cells and select "Delete" and then select "Shift cells up".

Now remove the filter and see if you have the result you wanted.

Apologies if my terminology is not quite right but I do not have excel available at the moment.
 
Matt,

If your tables are Structured Tables, there's way to select table rows for deletion that does not include entire rows.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

You Matter...
unless you multiply yourself by the speed of light squared, then...
You Energy!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top