accessing rows with macros

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top