PDA

View Full Version : Solved: Locking a Row Question



snowdyce
10-18-2012, 06:53 AM
Hello everyone,

I am having a little trouble locking a row. I do not want to allow input to certain rows if the condition is met. If the Condition is met, I call a routine. Below is the code I currently have. When I run it and test it, I am still able to change the values in the cells. Any advice?

Call Lock_Rows(21 + i, 5)

Public Sub Lock_Rows(x, y)
Worksheets("Sheet1").Range(Cells(x, 1), Cells(x, 80)).Locked = True

End Sub

Kenneth Hobs
10-18-2012, 07:23 AM
Did you protect the sheet?

snowdyce
10-18-2012, 08:51 AM
Hi Kenneth, I learned that after my post. So I made everything unprotected, the picked my rows to Lock and protected the entire sheet. It is working well now. Thanks. I will close this thread.