Find Value Across All Worksheets

  • Hi,

    I'm trying to use a simple for to search the entire workbook for 1 value. Below you will have the code I currenlty have but I keep getting an error stating that "Oject variable or With block variable not set". Can someone point me in the right direction please. Thank you in advance.

    The code in yellow is what "debug" highlights as the issue.

  • Re: Form To Seach Workbook For A Value

    That seems a lot of code just to find a value!, try this:

    run the macro, enter the word or number or whatever to look for and take it from there, you should be able to modify it!

  • Re: Form To Seach Workbook For A Value

    Thanks for the reply.

    I tried the code you posted but I get the same error message. Would it had anything to do that what I'm trping is not an exact match to the cell value? (It would be names of reports ei. I would search for Basedata but the reports would actually be call Basedata Quarterly). And this might not be possible but I was also looking to it setup that when I enter a value to search to have excel bring me to the sheet and high light the row it found. and maybe have another box come up (something like "Next") just in case that is not the report I'm looking for.

    Again thanks for your help.

  • Re: Form To Seach Workbook For A Value

    I just used the code below i had a cell with two words in one of which i was looking for, in the input box i entered the word and it found it no problem, i have now fixed it so that it highlights the entire row.

  • Re: Form To Seach Workbook For A Value

    That code just does not seem to work for me... I keep getting the same error.

    but it seems I found a code in anouther thread that actually is doing most of what I need.

    Thanks for your help.

  • Re: Form To Seach Workbook For A Value

    There are a couple of reasons you could be getting errors. Add a period into:


    Also, if the value you are looking for isn't on the active sheet the rfound would error so I threw in:

    On Error Resume Next

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!