Link to home
Start Free TrialLog in
Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on

Delete rows whenever cells in the first column of tables start with a specific string (using VBA)

Dear Experts:

My current document features several tables.

There are cells in the first column of the tables that start with the string 'X_'

I would like to run a macro that deletes the whole row whenever table cells in the first column start with that string 'X_'

The macro is to tell in a Msgbox how many rows have been deleted, if any.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

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
SOLUTION
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
Avatar of Andreas Hermle

ASKER

Dear both,

both solutions work just fine, thank you very much for it.

I can learn from both :-)

Since Rgonzo (Rafael) was quicker and his code is more concise, I suggest awarding him the most points.

It is always hard for me to award points ...

Thank you very much for your great and professional help.

Regards, Andreas
You're welcome Andreas! Glad we could help.