Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
[email protected] genesalkovsky@gmail.com is offline
external usenet poster
 
Posts: 1
Default Search and replace blank cells with "N/A" within a Word Table

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

  #2   Report Post  
Posted to microsoft.public.word.tables
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 285
Default Search and replace blank cells with "N/A" within a Word Table

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


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.


wrote:
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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The search "Find Next" with "wildcards" does not function properly Philos Microsoft Word Help 4 September 10th 06 06:43 AM
"find" and "search/replace" modes bettysue Microsoft Word Help 5 June 29th 06 08:15 PM
To be able to jump by style (like "Find Next" in "Search") MickeyVip Microsoft Word Help 2 January 31st 06 11:43 AM
disable "first letter of table cells" in "AutoCorrect" with regist Harald malek Microsoft Word Help 1 December 28th 05 04:36 PM
"Search" function does not work in Word 2002. Any suggestions? D Taylor Microsoft Word Help 0 October 20th 05 02:21 PM


All times are GMT +1. The time now is 09:34 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"