
Originally Posted by
foxguy
There is no code in my file to copy & paste. I converted your InputBox to a Userform so that the user could easily type in more than 1 word. Otherwise the user would have to be given instructions on how to enter more than 1 word in the InputBox.
To move the Userform into your workbook:
1) Open the Project Explorer (Alt+F11 opens VBE, then Ctrl+R to open Project Explorer).
2) Find you workbook and my workbook (mine will be named "VBAProject(Macro to Search and Copy Multiple Keywords into Another Sheet)" and yours will be named "VBAProject(YourWorkbookName)")
3) Find the UserForm in my workbook, and drag & drop it into yours (left mouse click the userform & hold button down, move the cursor to your workbook and release mouse button)
4) Double click on the userform in Project Explorer (this will open the form for editing).
5) Double click on the form itself (not one of the boxes). This will open the code behind the form.
6) Find the sub named "SearchKeywords" and modify the sheet names in the section between the '****************
I apologize for all the trouble I'm giving you but I'm getting an error after I perform the steps you mentioned in your last post.
I get this error: "Run-time error '1004': Method "Range" of object'_Global" failied. When I click on debug it highlights this line:
I think I am getting the error after the first time I try to run it, or after I click the command button twice. It also doesn't seem to be pasting the search results after I click once, the inbox just stays open and the workbook is unchanged. It's really weird. Below is how my code reads.
For reference, keywords are being searched from the first sheet in the workbook, this sheet is presently named "All Levels - Combined"....
Then the goal is to be able to have two key words searched and once, with the results pasted into sheet named "Sheet1"
Do you think these sheet names are the reason for the error? VBA code is confusing to read so maybe I changed the sheet names in the section you refered to incorrectly?
Here's the code copied and pasted from the viewing the code form "Userform1"
What are your thoughts? Am I an idiot and doing this wrong? I've spent a bunch of time looking up the error codes and trying out different suggestions from the internet as I didn't want to bug you again but I thought after 4 hours of trying I'd ask you again. I'm sorry this isn't getting resolved quickly, I really do appreciate the help you've been giving me. And yes, I'm getting pretty desparate
Bookmarks