Check if a cell contains a word

Osefa -  
melanie1324 Posted messages 1561 Status Membre -
Hello,

I'm looking to test in a loop whether a cell contains the word "auto," for example.
I know the syntax for Range, which is to do:

If Range("A1").Value Like "*AUTO*" Then

But I would like to find the syntax for Cells (more convenient for me).

Thank you!

1 réponse

melanie1324 Posted messages 1561 Status Membre 156
 
Hello,

the syntax for cells:

'cells(RowNo,ColumnNo)
if cells(1,1).value like "*AUTO*" Then
0
Osefa
 
Oh okay, so the syntax is pretty much the same?
I thought we could access the content of Cells without using value, right?
0
melanie1324 Posted messages 1561 Status Membre 156
 
In fact, what you write:
if range("A1").value = 1
if range("A1") = 1
if cells(1,1).value = 1
if cells(1,1) = 1

means exactly the same thing.
0