English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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

2 answers

In the time it would take to do a custom macro you could do a zillion cut and paste operations. Put the cursor in the first box of that column. Type in "N/A" and then highlight it. Use control-C to copy it. Now go down tot he next box and use control-V to paste it there. Keep repeating the paste in every empty box that needs it. You will find that after a box or too you can get a rhythm going so that the whole task just takes a few seconds for each insertion. It is not classy but it will get you through the repair in a minute or so.

2006-09-19 03:09:39 · answer #1 · answered by Rich Z 7 · 0 0

You don't have to use the find and replace funtion. Use copy and paste instead. First just type N/A into the first empty cell in specified column. Then copy contents of said cell (control + C). Then select second empty cell of specified column by clicking it and then holding shift... scroll down to last page (click and drag on scroll bar) and click on last cell of same specified column. All cells in only specified column should be selected. Then paste (control + v). The whole selected column should fill up with N/As. All specified columns on all pages in one paste keystroke. Easy.

2006-09-19 11:20:57 · answer #2 · answered by Thomas Aeruthayan 1 · 0 0

fedest.com, questions and answers