So if a cell contains "catsdogs" i want some code that would return
true
If Cells(Rowx, Coly) = "cat" Then
x = true
This does not work
So if a cell contains "catsdogs" i want some code that would return
true
If Cells(Rowx, Coly) = "cat" Then
x = true
This does not work
If Cells(Rowx, Coly) Like "*cats*" Then
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
"Shani" <[email protected]> wrote in message
news:[email protected]...
> So if a cell contains "catsdogs" i want some code that would return
> true
>
> If Cells(Rowx, Coly) = "cat" Then
> x = true
>
>
> This does not work
>
Hello Shani,
Use the InStr function as below:
If InStr(1, CStr(Cells(Rowx, Coly).Value), "catsdogs") <> 0 Then
x = True
End If
Best regards
John
"Shani" <[email protected]> wrote in message
news:[email protected]...
> So if a cell contains "catsdogs" i want some code that would return
> true
>
> If Cells(Rowx, Coly) = "cat" Then
> x = true
>
>
> This does not work
>
thank you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks