View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default


For i = 1 To Cells(Rows.Count,"A").End(xlUp).Row
If Cells(i,"A") = "somevalue" Then
'do something
End If
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Sam" wrote in message
oups.com...
Hi,
I'm quite new to excel. I'd like to loop through all the rows in my
sheet and compare the text in the cells of the first column with some
string variable priorly set.
How can I do that ?

Also I would like to disable my cells for editing, so that only my
function run when I click on a button can modify those cells. I've done
it through protecting the sheet from editing, but then even my macro
can't edit the cell without having to enter the password;)

Thx