Macro to delete a row in a table

C

CAP

I need a macro to search tables in a word document, find blank cells and
delete the row that they are in
any offers?
 
G

Greg Maxey

Try something like:
Sub scratchmacro()
Dim oTbl As Table
Dim oCell As Cell
Dim i As Long
For Each oTbl In ActiveDocument.Tables
For Each oCell In oTbl.Range.Cells
If Len(oCell.Range.Text) < 3 Then
i = oCell.RowIndex
oTbl.Rows(i).Delete
End If
Next
Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top