Consulting

Results 1 to 3 of 3

Thread: Solved: Locking a Row Question

  1. #1
    VBAX Regular
    Joined
    Oct 2012
    Posts
    35
    Location

    Solved: Locking a Row Question

    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?

    [VBA]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
    [/VBA]

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Did you protect the sheet?

  3. #3
    VBAX Regular
    Joined
    Oct 2012
    Posts
    35
    Location
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •