I have a rather long table of text in MS Word (It's too hard to copy it into excel due to formatting of the text). One column specifies whether the entry is applicable or not. The person who filled it out left all of the N/As blank. How can I do find & replace for empty table cells (in 1 column) and place 'N/A' if a cell is empty? I'm assuming I'll need a macro. I've done simple macros in excel before, but not in word. I'm running office 2003. Help? Thanks
2006-09-19
03:02:40
·
2 answers
·
asked by
curious1223
3
in
Computers & Internet
➔ Software
My table spans 100 pages.
2006-09-19
03:17:19 ·
update #1
Some cells in the column in question have text in them. I don't want to replace those with 'N/A'. I just want to find empty cells and put N/A in there.
2006-09-19
06:18:03 ·
update #2
I had to figure it out myself. Here is the code/macro for replacing all empty cells (with N/A) in the 5th column of the first table in the document:
Dim oCell As Cell
For Each oCell In ActiveDocument.Tables(1).Columns(5).Cells
If oCell.Range.Text = Chr(13) & Chr(7) Then
oCell.Range.Text = "N/A"
End If
Next oCell
I'll leave this question open for a few more days to see if anyone can improve the code to take input from the user as to which column # they want to work with.
2006-09-20
07:13:21 ·
update #3