Search and replace blank cells with "N/A" within a Word Table

G

genesalkovsky

All:
I have done some research, but no luck on my part. I have
approximately 100 test scenarios that need to be updated. The
scenarios were written in Word and instead of the test writer putting
in "N/A" for a blank cell, they, in fact, left it Blank.

So, I would like to know if someone could help me where I have a macro
that searches the document and places the word "N/A" in place of any
empty cell within a table in a document.

Thank you.
Gene
 
G

Greg Maxey

Sub Scratchmacro()
Dim oTbl As Word.Table
Dim oCell As Word.Cell
For Each oTbl In ActiveDocument.Range.Tables
For Each oCell In oTbl.Range.Cells
If Len(oCell.Range.Text) = 2 Then
oCell.Range.Text = "N/A"
End If
Next oCell
Next oTbl
Set oTbl = Nothing
Set oCell = Nothing
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