+ Reply to Thread
Results 1 to 3 of 3

Lock cell in range(s) after input

  1. #1
    Registered User
    Join Date
    08-27-2018
    Location
    London
    MS-Off Ver
    office 2016
    Posts
    45

    Lock cell in range(s) after input

    Ho do I lock a cell after input?

    I found this code
    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    the password of the sheet is cream

    But when the code is entered it generates an error "compile expected line number or label or statement or end of statement" and the cell is not locked when checked

    how do i expand this code to include multiple row like b12;h12 and b26:h26

    (I do not know if this is relevant
    but the ranges b9;h9 etc are data validated to only accept certain specific values to be entered and the cells are configured not to display the entered values but just provide feedback in a different cell if it is correct)

    I have tried variations of this code but all with the same error
    Last edited by diddy47; 04-06-2019 at 06:27 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Lock cell in range(s) after input

    I can run this code with no errors. Are you sure that what you put in your post is exactly what is in your file? I think there is something relevant that you are not including. What line of code is highlighted when this error occurs?

    Do you want to check for every row in B:H or just certain rows? You don't need an intermediate variable, you can do this:

    Please Login or Register  to view this content.
    If you want all rows, then this:

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    08-27-2018
    Location
    London
    MS-Off Ver
    office 2016
    Posts
    45

    Re: Lock cell in range(s) after input

    Ok, that worked thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. lock/unlock cell based on another cells input
    By 2funny4words in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-21-2013, 03:17 PM
  2. Replies: 3
    Last Post: 03-06-2013, 05:47 PM
  3. [SOLVED] Lock cell(s) after data input using macro.
    By kawaitang in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-28-2013, 02:44 PM
  4. [SOLVED] Cell Range Lock Down Problem
    By Julez80s in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2012, 07:39 PM
  5. User to input character "A", but cell will show time stamp, and lock the cell.
    By matrix1108 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2012, 01:02 PM
  6. Conditional Formatting - Grey Out and Lock A range based on a cell value in that range
    By Excelgnome in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2012, 07:31 PM
  7. Conditionally lock cells based on value in input cell
    By mbrady1973 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-09-2008, 06:54 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1