is there any chance to find a word in for example a1 in b1

inspectoRQ

New Member
Joined
Jun 15, 2011
Messages
38
have a nice day all. i wanna know if it is possible to find word situated in a1,if that word in b1

for example

a1
have a nice day all to find if any of these word (have,nice, day, all)in b1

b1 contains

i have a nice t-shirt. if b1 contains any word in a1 the "wooow that`s great!! else ":("
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Can you explaine bette the results you want to achieve?

A1 contains:
have a nice day all

B1 contains::
i have a nice t-shirt

Each cell contains "have a nice" and then "wooow that`s great!!" have to be shown in A2?
Exact?
 
Upvote 0
Yes i meant it.

if b1 contains any word of a1,then else not

for example

a1

this is book is red

b1

if b1 contains ,"this", or "book" or "red" then ok else not
 
Upvote 0
If punctuation is notpresent try this:
Code:
Sub test()
memo = Split(Range("B1"), " ")
For i = LBound(memo) To UBound(memo)
Set check = Range("A1").Find(memo(i), LookIn:=xlValues)
If Not check Is Nothing Then
Range("A2") = "Wooow that`s great!!"
If Range("A2") = "Wooow that`s great!!" Then Exit Sub
Else
Range("A2") = "Sorry!!"
End If
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,866
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top