+ Reply to Thread
Results 1 to 16 of 16

Search entire sheet for text

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Search entire sheet for text

    Hello,

    I have a test that I need to run over 100 times where I drop raw data (a pdf converted to excel) into the data sheet tab on the attached and perform a search based on a list on the List tab to see if it finds a match so that I can flag where matches are missing. It doesn't need to be a loop for 100 times. There would be a separate file for each test. I tried =COUNTIF(Sheet1!$1:$1048576,"*"&'Exhibit 7 - Lease in Place'!D13&"*") but it doesn't seem to be working for many in the list. Any ideas how I can do this? The raw data comes out with many different variations of the converted data and I don't have time to build a macro to clean up the converted pdf info.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Search entire sheet for text

    Can you give an example of the result you expect
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Search entire sheet for text

    I literally just want it to pass or fail. Fail would mean the item in the list is not on the data sheet. And the list can vary in size.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Search entire sheet for text

    Let see for next example :
    row 13 the value to search is apple is it ?
    It exists in row 376 & 3818 correct ?

  5. #5
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Search entire sheet for text

    That is correct. Maybe a pass/fail column and a count column to see if it exists more than once?

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Search entire sheet for text

    See next code for the first run
    a "x" is added in column "C" when exists
    It takes time ...so to count will take really longer
    Please Login or Register  to view this content.
    Last edited by PCI; 07-18-2018 at 05:23 PM. Reason: Statement "For Each" updated

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Search entire sheet for text

    Another one with counting .... be patient
    Please Login or Register  to view this content.
    Last edited by PCI; 07-18-2018 at 05:22 PM.

  8. #8
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Search entire sheet for text

    you're the best. Thanks. I will test it out now.

  9. #9
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Search entire sheet for text

    how would the code change if the text list i am searching is in column D and I want the test performed in column S?

  10. #10
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Search entire sheet for text

    See next code and adjust const to your need.
    Pay attention to the Reputation if you are please.

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Search entire sheet for text

    Thank you so much for your help. I get an overflow error at this point in the code when I run it.

    NbT = NbT + 1

  12. #12
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Search entire sheet for text

    OKAY
    It means you have a lot of data ....and the number of times the searched string appears is more than 32000 ????
    Change

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Search entire sheet for text

    Thanks. I got an object variable error this last time. I attached a better version of the file. Exhibit 7 column D has a list of text names/tenants that I am trying to see if they are on the second tab
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Search entire sheet for text

    With a sample Excel file it is always better ...!
    The issue was the first row changed from 1 to 13 ...!
    See const HR for header row
    Try next code
    Please Login or Register  to view this content.
    Last edited by PCI; 07-20-2018 at 11:49 AM. Reason: Typo

  15. #15
    Forum Contributor
    Join Date
    10-24-2012
    Location
    Chicago
    MS-Off Ver
    O365
    Posts
    311

    Re: Search entire sheet for text

    works awesome and pretty quickly too. Thank you so much.

  16. #16
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Search entire sheet for text

    You 're welcome and say hello from me to Sears Tower, Lake shore Drive, Water tower and other River City and of course the French school ...!
    Thx for the Rep

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to search sheet 1 for value and insert entire row from sheet 2
    By mtlong88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-09-2011, 01:21 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1