Avatar of Andreas Hermle
Andreas Hermle
Flag for Germany asked on

Conditionally delete rows in currentliy selected table

Dear Experts:

On the currently selected table I would like to perform the following actions using VBA

The macro is to loop thru the first column of the selected table and look for the term 'error' there. If found the whole row is to be deleted. Of course there could be many cells in the first column where this term 'error' occurs.

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

Regards, Andreas
VBAMicrosoft Word

Avatar of undefined
Last Comment
Andreas Hermle

8/22/2022 - Mon
Fabrice Lambert

Do you want to do that with MS Excel or MS Access ?

With MS Excel, you can use the delete methode of the range object.
Dim wb As Excel.Workbook
Dim ws As Excel.Worksheet

Set wb = ThisWorkbook
Set ws = wb.Worksheets(1)
ws.rows(5).Delete shift:=xlUp

Open in new window


With Access, you can use a query.
Andreas Hermle

ASKER
Hi Farbrice

thank you very much for your quick help. I was posting his question on the Word for Windows Section :-)
ASKER CERTIFIED SOLUTION
Rgonzo1971

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.
Andreas Hermle

ASKER
Hi Rafalel,

works great as always :-)

Thank you very much for your superb help. I really appreciate it. Regards, Andreas
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck