S
SF
I want to find various words in a document using the following method:
I will copy a word to my clipboard, and then:
Create a macro to take that word from the clipboard and find it in the text
of a Word document.
Here's my problem:
When I double click the REC macro button and then paste the selected word
into the "Find" dialogue box, that word gets permanently embedded into the
macro code!
So if I stop the macro, then manually select another word, and copy it to
the clipboard, and then run the macro . . . .
it goes and finds the old word!
Because that word is in the macro code----regardless of what I copy to the
clipboard next!
I sure hope this makes sense.
More importantly, I sure hope someone understands what I mean.
(More importantly, still, I sure hope someone can give me an answer . . . .
I think what I need is a variable, MyString As String
Then copy the selected text into MyString
Then set:
With Selection.Find
.Text = MyString
But I tried this and it doesn't work.
I think the variable (MyString) has to be converted to something in quotes.
SF
I will copy a word to my clipboard, and then:
Create a macro to take that word from the clipboard and find it in the text
of a Word document.
Here's my problem:
When I double click the REC macro button and then paste the selected word
into the "Find" dialogue box, that word gets permanently embedded into the
macro code!
So if I stop the macro, then manually select another word, and copy it to
the clipboard, and then run the macro . . . .
it goes and finds the old word!
Because that word is in the macro code----regardless of what I copy to the
clipboard next!
I sure hope this makes sense.
More importantly, I sure hope someone understands what I mean.
(More importantly, still, I sure hope someone can give me an answer . . . .
I think what I need is a variable, MyString As String
Then copy the selected text into MyString
Then set:
With Selection.Find
.Text = MyString
But I tried this and it doesn't work.
I think the variable (MyString) has to be converted to something in quotes.
SF