Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Set up find/replace in a macro | Microsoft Word Help | |||
Macro Button Won't Stay on Toolbar | Microsoft Word Help | |||
Possible bug when recording a Word Macro | Microsoft Word Help | |||
Macro to Find/Replace (with MailMerge Field)? | Mailmerge | |||
2000 to 2002 macro and "Could not open macro storage" | Mailmerge |