+ Reply to Thread
Results 1 to 7 of 7

Detecting successful replace or searching a large sheet fast

  1. #1
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Detecting successful replace or searching a large sheet fast

    I have a workbook containing a sheet with over 45K rows and abt. 55 columns (workbook is over 15 MB, so can't post it).
    I need to find out whether that sheet contains a certain text.

    Is there a fast way to do this?

    Checking each cell takes ages. So does Find.

    Somewhere on the internet I ran into a suggestion to use Replace iso Find.
    Trying this manually looks very promising.
    What I cannot find is how to detect (in VBA) whether a replacement actually occurred (thus telling me that the sheet contains the text I'm looking for).
    MSDN suggests that Replace return some boolean, but I didn't yet manage to capture anything.

    Any ideas how to do this?
    Or any ideas how to do the find quickly?
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Detecting successful replace or searching a large sheet fast

    Did you use find function ONLY or find and find next functions together? Depending on the what are trying to find, you can incorporate the find,next function to speed up the execution.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Detecting successful replace or searching a large sheet fast

    Hello

    I developed this macro to provide an extremely fast search for a single column of data. Perhaps you can adapt this to your needs. The macro returns a 1-D array of the matching results.
    Please Login or Register  to view this content.
    Eaxample
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Detecting successful replace or searching a large sheet fast

    I tried the find dialogue in the sheet (not in VBA) to see if it would make difference.
    Will try find next in VBA.
    Thx for the quick response

  5. #5
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Detecting successful replace or searching a large sheet fast

    Thx Leith for your quick response
    This certainly looks like addressing my problem. Will try it.
    I'll let you know.

  6. #6
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Detecting successful replace or searching a large sheet fast

    Hi Leith,
    tried your function and it's bloody fast! And so simple. I love it!
    Thx a lot. Problem solved!

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Detecting successful replace or searching a large sheet fast

    Hello Tsjallie,

    You're welcome.

+ 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. Fast switching between large number of worksheets
    By dilipandey in forum Excel Tips
    Replies: 0
    Last Post: 07-20-2012, 01:31 AM
  2. how to fast replace
    By simone77 in forum Excel General
    Replies: 2
    Last Post: 03-27-2012, 12:12 PM
  3. Fast character replace ?
    By Pengo3005 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-08-2007, 10:51 AM
  4. Fast export large 2-dim array to worksheet
    By aafraga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-08-2006, 11:00 AM
  5. searching a table - fast!
    By mas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-09-2005, 05:06 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