Reply
 
Thread Tools Display Modes
  #1   Report Post  
 
Posts: n/a
Default macro asking for word to find/replace

Hello you all:


I need to create a macro da fits some particular questions while
running.
I wonder if it's possible to create an action where I ask part of the
find word? Something like:


"find for: "XXXX" & ^#^#" where XXXXX is the field and it's any word
and the ^#^# any two digits. Something like this "myparents01". After
inserting the word the macro would continue to do the find/replace
action and the next actions too.


Thank you once again for your good help.


Abel.

  #2   Report Post  
Greg
 
Posts: n/a
Default macro asking for word to find/replace

Do you remeber that macro I posted for you about your Uncle Bob?

Modify as follows.

Add:
dim oFindWord as String
oFindWord = InputBox("Type the word you want to fine")

Change

..Text = "Bob's your uncle"
to
..Text = oFindWord

Bob's still your uncle ;-)

  #3   Report Post  
 
Posts: n/a
Default macro asking for word to find/replace

Dear Greg:
Thank you for all your concern and help here.

For all of you which may be interested here goes the final code:
Sub Potatoes()
Dim oFindWord As String
oFindWord = InputBox("Type the word you want to fine")
With Selection.Find
.Text = oFindWord
.Replacement.Text = "favorit sista"
.Execute Replace:=wdReplaceAll
End With
End Sub

Abel

  #4   Report Post  
Greg
 
Posts: n/a
Default macro asking for word to find/replace

Before you make it final, you might want to change
"Type the word you want to fine" to "Type the word you want to find"

In case you aren't sure about the replacement (maybe it isn't your
favorite sista after all) you might add:

Dim oReplaceWord As String
oReplaceWord = InputBox("Type the word replacement word or phrase")

Change
..Replacement.Text = "favorit sista" to
..Replacement.Text = oReplaceWord

Good luck with all them favorite relatives.

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
Set up find/replace in a macro Haydon Microsoft Word Help 3 June 29th 05 11:07 AM
Macro Button Won't Stay on Toolbar caleb Microsoft Word Help 2 June 14th 05 11:59 PM
Possible bug when recording a Word Macro Raven95 Microsoft Word Help 4 April 30th 05 09:49 PM
Macro to Find/Replace (with MailMerge Field)? aiyou Mailmerge 1 December 8th 04 07:39 AM
2000 to 2002 macro and "Could not open macro storage" Art Farrell Mailmerge 1 December 6th 04 12:40 PM


All times are GMT +1. The time now is 08:49 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"