Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-16-2016, 10:02 AM
Marrick13 Marrick13 is offline Need to improve speed of Excel macro that searches for whole word matches Windows XP Need to improve speed of Excel macro that searches for whole word matches Office 2010 32bit
Competent Performer
Need to improve speed of Excel macro that searches for whole word matches
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default Need to improve speed of Excel macro that searches for whole word matches

I’ve constructed macros that search a user range on a worksheet and looks for whole word matches (one provides case sensitive and the other insensitive searches with the option compare statements). It extracts the matches it finds to a new workbook. It determines the whole word match by testing whether the search text in the range is preceded or followed by a non-letter or non-number.



It runs very well if there are a small number of hits, even if the search range is several thousand rows, but slows down if it finds a lot of hits, probably because it loops through the ASC characters for the front and back of the search hit. For example, with a range of about 5800 rows of data, it took just over 2 minutes to extract 455 hits. But searching the same range for a different criterion that had only 14 hits took around 15 seconds.

Does anyone have a suggestion for speeding this code up when the hit count is high? Macro is attached in text file.
Attached Files
File Type: txt Find_Whole_Word_CS.txt (3.4 KB, 7 views)
Reply With Quote
 

Tags
case, search, whole word match



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to speed up macro AC PORTA VIA Excel 3 10-30-2015 08:58 PM
Excel formula required to speed up process of creating species rarefaction curves. Ecology! Tim_F Excel 2 07-18-2014 04:56 AM
Need to improve speed of Excel macro that searches for whole word matches word and keyboard speed ptz Word 2 09-20-2012 06:37 AM
Need to improve speed of Excel macro that searches for whole word matches Help -can i improve this way of working? lucky67 Office 1 01-26-2012 09:20 PM
Need to improve speed of Excel macro that searches for whole word matches Change how windows searches cadams Office 1 12-07-2010 10:01 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft