Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing data
I need to compare a word in a single cell to a group of words. If that single word matches any one of the group I'd like to return a "Yes". The group of words are currently in a comma delimited text file so I can arrange them however needed. I hope someone can help. -- srs710 ------------------------------------------------------------------------ srs710's Profile: http://www.excelforum.com/member.php...o&userid=25377 View this thread: http://www.excelforum.com/showthread...hreadid=388577 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing data
Hi SRS710,
Try something like:: Sub Tester() Dim sStrWord As String Dim arr As Variant sStrWord = Range("A1").Value '<<===== CHANGE arr = Array("Word1", "Word2", "Word3", "Word4", "Word5") MsgBox IIf(Not IsError(Application.Match _ (sStrWord, arr)), "Yes!", "No!") End Sub --- Regards, Norman "srs710" wrote in message ... I need to compare a word in a single cell to a group of words. If that single word matches any one of the group I'd like to return a "Yes". The group of words are currently in a comma delimited text file so I can arrange them however needed. I hope someone can help. -- srs710 ------------------------------------------------------------------------ srs710's Profile: http://www.excelforum.com/member.php...o&userid=25377 View this thread: http://www.excelforum.com/showthread...hreadid=388577 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing data
Hi,
Using a formula rather than VBA: Place (for example) in B1: =IF( ISERROR(MATCH(A1,D1:D20,0)),"No","Yes") where A1 contains word to be matched D1 to D20 contains list of words to be searched MATCH is not case sensitive. HTH "srs710" wrote: I need to compare a word in a single cell to a group of words. If that single word matches any one of the group I'd like to return a "Yes". The group of words are currently in a comma delimited text file so I can arrange them however needed. I hope someone can help. -- srs710 ------------------------------------------------------------------------ srs710's Profile: http://www.excelforum.com/member.php...o&userid=25377 View this thread: http://www.excelforum.com/showthread...hreadid=388577 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
comparing two columns of data and return unique data in another co | Excel Discussion (Misc queries) | |||
comparing data | Excel Discussion (Misc queries) | |||
help comparing two sets od data to find the odd data | Excel Worksheet Functions | |||
comparing lists of data to remove duplicate data | Excel Discussion (Misc queries) | |||
Comparing data in two columns and highlighting the data | Excel Worksheet Functions |