+ Reply to Thread
Results 1 to 5 of 5

Autolocking cell after entering number and protecting the cell from editing

  1. #1
    Registered User
    Join Date
    08-02-2014
    Location
    Ashgabat, Turkmenistan
    MS-Off Ver
    2013
    Posts
    23

    Lightbulb Autolocking cell after entering number and protecting the cell from editing

    Hi.
    I need help guys with vba.
    So I created a table as shown in the attachment file. What I want is to autolock the cells from editing after entering the number between B2:M2, B3:M3 and so on. And password protect each cell under the sum column.
    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Autolocking cell after entering number and protecting the cell from editing

    Hi
    Three simple macros will do this for you.

    The first one will run when you open the workbook
    It selects your sheet and range B2 but those lines are not important.
    The important part is that it creates a public variable "Store"

    Please Login or Register  to view this content.
    The Second Macro does two things.

    Firstly it moves the cursor to N1 whenever any cell in column N is selected.
    This prevents column N being modified.

    Secondly if any cell in your data range is selected, it saves the value in that cell in store.

    Please Login or Register  to view this content.
    The last macro, stops any cell in the data range being modified.

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 08-02-2014 at 02:34 PM.

  3. #3
    Registered User
    Join Date
    08-02-2014
    Location
    Ashgabat, Turkmenistan
    MS-Off Ver
    2013
    Posts
    23

    Re: Autolocking cell after entering number and protecting the cell from editing

    Dear Mehmetcik.
    Since I'm no good in programming can you help me with making final version of the excel table. I created the final version of the table and attached to the thread. Logic is same autolock after entering the number cell from B2:Y2 and downwards. And protecting the cells starting from Z2 and downwards. And can you help me with enabling and disabling the protection of the cells from Z2 and downwards.
    Thank you very much my friend.

    P.S. And one more problem. When I try delete or modify any cell in range B2:Y2 i can't but when I select two and more cells and press delete it give run time error "13" and deletes the content/s of the cell.
    Last edited by batya; 08-04-2014 at 02:57 AM.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Autolocking cell after entering number and protecting the cell from editing


  5. #5
    Registered User
    Join Date
    08-02-2014
    Location
    Ashgabat, Turkmenistan
    MS-Off Ver
    2013
    Posts
    23

    Re: Autolocking cell after entering number and protecting the cell from editing

    Excellent my friend. I need one more favor After each input can I make excel to auto save? 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. Entering a number in a cell using the mouse
    By Michael6 in forum Excel General
    Replies: 15
    Last Post: 07-10-2014, 09:36 AM
  2. Replies: 5
    Last Post: 06-20-2012, 08:39 AM
  3. Replies: 2
    Last Post: 10-25-2009, 04:04 PM
  4. Disable Editing a Cell Without Protecting the Worksheet
    By akabraha in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-02-2008, 06:46 PM
  5. [SOLVED] entering number down to cell
    By kayani in forum Excel General
    Replies: 1
    Last Post: 07-25-2006, 01:45 PM

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