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