Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-17-2016, 09:18 PM
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: 103
Marrick13 will become famous soon enough
Default

The original request was my own doing. I had code that extracted text I searched regardless of case and matching whole words (I adapted it from http://stackoverflow.com/questions/2...n-one-workbook). I usually got rows that I didn't want just because the code wasn't matching, so I wondered about changing it to match the whole word. Not being a VBA guru, I had to look for examples that I could maybe adapt for my purpose.



I did just comment out two lines of code: the 'If b < 48 Or a > 57 Then' and the 'If a < 48 Or b > 57 Then' which I had added so the code would include numbers adjacent to the search text when it was looking to determine if the whole word was a match. When I ran that code, it found the same number of hits as the original code above searching for a word that I knew was a whole word in all 260 occurrences. With that b < 48 Or a > 57 code uncommented, I got 89 hits on the same search term. That is great - but if I added a number to the search term in one of the rows, the code doesn't recognize it, whether or not the b < 48 Or a > 57 lines are there. So the way it is now, I think the only reason lines will be skipped is if the search term is either preceded or followed by a number (without a space). I guess I can live with that. In the example you mention (seq 23: Antikythera, seq29: no space between writes and the seq 108 and 109: Southern Ohio), 'the' is not a whole word, so on a whole word match run, I don't want those rows. Only if I choose "all occurrences" would I want to see 'the'.

If you can suggest a way to have the code see numbers without compromising the other (whole word match) searching, I''d be happy to hear it!
Reply With Quote
Reply

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 08:13 PM.


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