Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-16-2023, 06:29 AM
Reyaaz Reyaaz is offline Exact text search in a range of cells Windows 11 Exact text search in a range of cells Office 2021
Novice
Exact text search in a range of cells
 
Join Date: Jan 2023
Posts: 3
Reyaaz is on a distinguished road
Question Exact text search in a range of cells

Hi, all.



I have a search textbox macro for cell B1, which checks a range of cells in sheet 2, and returns any cells which include the search term.
Sheet 2 has a number of paragraphs in the range of cells.

The search works, but how do I make it an exact search (not case-sensitive), for what is typed in B1.

Eg.
If someone types HR in B1, only cells which include an exact match are returned, and not any words (eg threat) which include the search term HR.
If someone types Perform in B1, only cells which include an exact match are returned, and not any words (eg performance) which include the search term perform.

This is the formula for the search so far:

=IF((LEN(B1))=0, "Product Search", FILTER('Product List'!A2:F152,ISNUMBER(SEARCH(B1,'Product List'!A2:A152))+ISNUMBER(SEARCH(B1,'Product List'!B2:B152))+ISNUMBER(SEARCH(B1,'Product List'!C2:C152))+ISNUMBER(SEARCH(B1, 'Product List'!D2152))+ISNUMBER(SEARCH(B1, 'Product List'!E2:E152))+ISNUMBER(SEARCH(B1, 'Product List'!F2:F152)),"No records found"))

Thanks
Reply With Quote
  #2  
Old 01-16-2023, 07:18 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Exact text search in a range of cells Windows 10 Exact text search in a range of cells Office 2021
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,770
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Please post a sample sheet ( no pics please) with 10-20 lines of data and some expected results.
Thx
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 01-16-2023, 07:32 AM
Reyaaz Reyaaz is offline Exact text search in a range of cells Windows 11 Exact text search in a range of cells Office 2021
Novice
Exact text search in a range of cells
 
Join Date: Jan 2023
Posts: 3
Reyaaz is on a distinguished road
Question Sample sheet

Thanks for your response, Pecoflyer.

In the attached example, the user types HR into the search box and a number of rows are pulled up which include HR.

A17 is fine as a search result, as it includes HR as a single word.

C15 and B16 are not, as they only include the word through, and not HR.

The info is gathered from the second sheet.
Attached Images
File Type: jpg searchable screenshot1.jpg (156.0 KB, 9 views)
Reply With Quote
  #4  
Old 01-16-2023, 10:24 AM
Reyaaz Reyaaz is offline Exact text search in a range of cells Windows 11 Exact text search in a range of cells Office 2021
Novice
Exact text search in a range of cells
 
Join Date: Jan 2023
Posts: 3
Reyaaz is on a distinguished road
Lightbulb Solution

This seems to work:

Exact text search in a range of cells | MrExcel Message Board
Reply With Quote
  #5  
Old 01-16-2023, 11:18 PM
ArviLaanemets ArviLaanemets is offline Exact text search in a range of cells Windows 8 Exact text search in a range of cells Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

Quote:
Originally Posted by Reyaaz View Post
In the attached example, the user types HR into the search box and a number of rows are pulled up which include HR.

A17 is fine as a search result, as it includes HR as a single word.

C15 and B16 are not, as they only include the word through, and not HR.
Instead "HR" search for "HR " (as leftmost characters in cell), " HR ", or " HR" (as rightmost characters in cell)

Edit: I.e. instead of single check, you have to check all 3 possibilities - in case any of them does pass, the record is displayed!

Last edited by ArviLaanemets; 01-17-2023 at 02:48 AM.
Reply With Quote
  #6  
Old 01-17-2023, 01:43 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Exact text search in a range of cells Windows 10 Exact text search in a range of cells Office 2021
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,770
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Thumbs down

Quote:
Originally Posted by Reyaaz View Post
Thanks for your response, Pecoflyer.

In the attached example, the user types HR into the search box and a number of rows are pulled up which include HR.

A17 is fine as a search result, as it includes HR as a single word.

C15 and B16 are not, as they only include the word through, and not HR.

The info is gathered from the second sheet.
As I said, please post a sample sheet NO PICS !

OTOH your problem seems to be solved somewhere else . Please read A message to forum cross posters - Excelguru
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
Reply

Tags
cells, exact, range

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
create a clickable text box to jump to a range of cells sahara Excel Programming 4 09-07-2017 10:56 AM
Distribute text in one cell across a range of cells (overcoming selection.range.cells.count bug) slaycock Word VBA 0 02-18-2017 07:00 AM
Exact text search in a range of cells Search Range Within Cell or Cells COEngineer Excel 1 06-01-2016 11:50 AM
Exact text search in a range of cells Search and reduce the range of a text selection paik1002 Word VBA 1 12-17-2015 04:51 AM
Copying text range of cells to different cells adds an extra line jpb103 Word VBA 2 07-23-2014 12:22 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:25 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