+ Reply to Thread
Results 1 to 4 of 4

VBA code locks entire sheet instead of a cell

  1. #1
    Registered User
    Join Date
    01-14-2020
    Location
    Lithunia
    MS-Off Ver
    O365
    Posts
    2

    VBA code locks entire sheet instead of a cell

    Hi,

    I have been working on this VBA code which lets me to lock a cell after data input. I tried on test and it was working but as soon as I copied it to the production file it stopped working. I am really lost why it isn't working.

    File has conditional formatting.

    Code:

    Please Login or Register  to view this content.


    UPDATE


    Issue is with conditional formatting. It doesn't work on those cells
    Last edited by Whooops; 01-16-2020 at 10:16 AM.

  2. #2
    Registered User
    Join Date
    08-25-2011
    Location
    England
    MS-Off Ver
    Excel 2003, 2010
    Posts
    37

    Re: VBA code locks entire sheet instead of a cell

    The cell being marked as locked is what the sheet protection is enabling. The cells of a sheet are marked as locked when created and the user has to mark them as unlocked to enable editing when a sheet is protected.
    What doesn't kill you is just biding it's time

  3. #3
    Registered User
    Join Date
    01-14-2020
    Location
    Lithunia
    MS-Off Ver
    O365
    Posts
    2

    Re: VBA code locks entire sheet instead of a cell

    But the thing is I have another xlsm file that runs same code and no issue there. I input my data -> Cell locked -> Input data to another cell -> Cell locked. That works fine on other file but on this I can't achieve that

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: VBA code locks entire sheet instead of a cell

    Hi,

    Sheets start out with all cells locked. You probably have to initialize the Sheet with the following code or equivalent before entering data for the first time:
    Please Login or Register  to view this content.
    Lewis

+ 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. [SOLVED] This Code LOCKS up VBA
    By CaptMac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2017, 12:19 AM
  2. VBA code to convert all data + formatting of entire sheet to VBA code
    By jocanon in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-14-2016, 06:56 PM
  3. [SOLVED] VBA code, cut and paste entire row into new sheet per specific condition in cell
    By Tapyr in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-07-2015, 08:53 AM
  4. VBA Code to Copy entire sheet and paste in another sheet
    By molly13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2015, 11:45 AM
  5. [SOLVED] Code locks cells when inserted in sheet module but returns error in standard module
    By yoda66 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2014, 07:39 AM
  6. Modifying code that locks a cell to be a password hidden in a specific cell?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2012, 02:38 PM
  7. Getting problem in VB code it locks up??
    By jesika in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 03-10-2009, 03:31 AM

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