A family of Microsoft word processing software products for creating web, email, and print documents.
Something seems to have disappeared from the original code in the link. I've updated it now, so try the update.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello All,
I am very new to the macro creation / Visual Basic world, but I have a great need that requires me to understand it, or at least to use a macro for this task.
I have many huge documents with similar word misspelling, errors, etc, and I believe that using a macro to find/replace multiple words at one time will be a huge help. I'm talking about thousands of words. I've already done one document so far, and it's taken me weeks.
I found many sample macros on this site and through different web searches that claim to do what I need. But I can't seem to get any of them to work.
And I think it's either because I don't know the "basics" of Visual Basic, or the code may be wrong. (But there's no way for me to tell.)
What I would like to do is make a list, to input into a macro, of words that could possibly be among those misspelled, and another list of what they should be. IE: List #1 would have the word "neighbour" and List #2 would have the word "neighbor". And this list would have thousands of words.
In my desperation, I've also tried using Notepad++, but I think this is only useful up to 9 words. :(
Anyway, if someone has any ideas, or can point me to a macro (I'm sure it's already been done) that works, I would truly be thankful.
PS. I have access to both Office 2010 and 2013.
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
Something seems to have disappeared from the original code in the link. I've updated it now, so try the update.
Answer accepted by question author
Okay thank you.
Now I got it to run, but I'm getting this error:
Run-time error '424':
Object required
I clicked on Debug to see what the problem was, and this line (down at the bottom) was highlighted:
For i = 1 To Sheets.Count
Any idea what happened?
Thanks!
So, Paul, I pasted your code into Visual Basic, and I also have an Excel File with columns A & B populated. At this time I have over 400 words to replace. I will be adding more later.
I've named the file 'WordSwapList', and placed it on my Desktop. Per your instructions I've changed 'StrWkBkNm' in the code to 'WordSwapList'. But I'm not quite sure what the 'StrWkSht' is. Any help from this point would be appreciated.
StrWkSht is the worksheet name. Since workbooks usually default to 'Sheet1' for their first worksheet's name, that's what the code has, via:
StrWkSht = "Sheet1"
If you're using a worksheet with a different name, you'll need to change the 'Sheet1' reference.
And, since you're using a workbook saved to your Desktop, you'll need to replace:
Documents
in the filepath with:
Desktop
Thank you Charles, Paul, and Rohn007 for your quick replies.
I'm not sure I want to go the Autocorrect route, as I only want to accomplish this task with specific documents.
So, I'd like to try using a macro to replace all the words I choose.
So, I've been using Paul's excellent suggestion. I wish I understood it more, but I've been making some headway.
And thank you for the Idiot's Guide, because it really did help to get me started.
So, Paul, I pasted your code into Visual Basic, and I also have an Excel File with columns A & B populated. At this time I have over 400 words to replace. I will be adding more later.
I've named the file 'WordSwapList', and placed it on my Desktop. Per your instructions I've changed 'StrWkBkNm' in the code to 'WordSwapList'. But I'm not quite sure what the 'StrWkSht' is. Any help from this point would be appreciated.
Thank you,
Alex