Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

How to search the entire worksheet with partial text and return the search results?

0

Hi, 

I have gone through the following helpful post from teachexcel.com 

https://www.teachexcel.com/excel-tutorial/2110/search-entire-workbook-amp-return-all-results-in-excel-advanced-method

With this code i get results only if the cells don't contain spaces and if i entire the exact value. Is there a solution where i can search for the partial cell value and get the results?

For example, I have a sheet with entries like "Moong dal, Moong dal yellow, Moong dal Chilka, Moong whole beans" If i search with just "Moong" word can i get all the 4 results which have "Moong" word in it? 

Answer
Discuss

Answers

0

Look for the line LookAt:=xlWhole in the code you have and replace it with LookAt:=xlPart

Discuss

Discussion

Hi Variatus,
Thanks for your reply. Unfortunately, I couldn't find "LookAt:=xlWhole " in the code I have attached to this post. Could you please have a look at it if you don't mind?
Dpal93 Feb 28, '20 at 6:32 am
It's in Sub SearchFind(). I found it with Edit > Find. You may be interested in my post on the Find method a few minutes ago, here
Variatus (rep: 4889) Feb 28, '20 at 9:21 pm
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login