Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

Find/Replace macro problem in selected table column

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hinesgg - 27 Dec 2004 19:55 GMT
I've created a macro that selects a column and performs several search and
replace functions in that column.  When I play the macro back Word asks the
user if (s)he wants to search the entire document after each search.  With
over 40 search/replace functions that gets a bit annoying.  Is there some
code I can include in the macro after each search to eliminate this?
Signature

Gail Hines
Texas State Auditor's Office
ghines@sao.state.tx.us
512-936-9760

Helmut Weber - 27 Dec 2004 20:12 GMT
Hi,

try
  .wrap = wdfindstop

But with columns there may be complications.

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
hinesgg - 29 Dec 2004 15:49 GMT
That didn't work.  The pop-up window I keep getting says:  Word has finished
searching the selection.  Do you want to search the remainder of the document?

Any other ideas would be appreciated.

> Hi,
>
[quoted text clipped - 8 lines]
> Word XP, Win 98
> http://word.mvps.org/
Klaus Linke - 29 Dec 2004 16:29 GMT
> That didn't work.

What didn't work? Did you look in your macro for all lines like
  .Wrap = wdFindAsk
and replaced them with
  .Wrap = wdFindStop
?

Klaus
hinesgg - 29 Dec 2004 16:59 GMT
Here's my code:

Selection.SelectColumn
   With Selection.Find
       .Text = "3_440 HR **"
       .Replacement.Text = ""
       .Forward = True
       .Wrap = wdFindAsk
       .Format = False
       .MatchCase = False
       .MatchWholeWord = False
       .MatchWildcards = False
       .MatchSoundsLike = False
       .MatchAllWordForms = False
   End With
   Selection.Find.Execute Replace:=wdReplaceAll
   Selection.Find.Wrap = wdFindStop

I'm not a programmer, so I created this macro by recording keystrokes. I
then copied and pasted the code and edited the contents in the quotation
marks.  After each search and replace I am asked if I want to search from the
beginning.  That pop-up box is what I'd like to eliminate.

Thanks for all your help.

> > That didn't work.
>
[quoted text clipped - 5 lines]
>
> Klaus
Greg Maxey - 29 Dec 2004 17:11 GMT
Trying changing
       .Wrap = wdFindAsk
To
       .Wrap = wdFindStop

Signature

Greg Maxey/Word MVP
A Peer in Peer to Peer Support

> Here's my code:
>
[quoted text clipped - 31 lines]
>>
>> Klaus
Klaus Linke - 29 Dec 2004 17:17 GMT
   Selection.SelectColumn
   With Selection.Find
       .Text = "3_440 HR **"
       .Replacement.Text = ""
       .Forward = True
       .Wrap = wdFindStop
       .Format = False
       .MatchCase = False
       .MatchWholeWord = False
       .MatchWildcards = False
       .MatchSoundsLike = False
       .MatchAllWordForms = False
   End With
   Selection.Find.Execute Replace:=wdReplaceAll

:-)  Klaus
hinesgg - 29 Dec 2004 17:49 GMT
Woo Hoo!  It worked.  

Duuuhhhh!  Guess I was looking in the wrong place.  

Thanks to all!

> > That didn't work.
>
[quoted text clipped - 5 lines]
>
> Klaus
Helmut Weber - 29 Dec 2004 20:37 GMT
Hi Klaus,

I see, giving the same advice twice or three times,
thanks to Greg, increases the effect by more then three times.
Reminds me of "Gestalt"-theory:
"The whole is more than the sum of it's parts."
Some, however, maintain that the opposite is true.
They are wrong, I'd say.

lol

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/

>> That didn't work.
>
[quoted text clipped - 5 lines]
>
>Klaus
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.