+ Reply to Thread
Results 1 to 6 of 6

Locking cells unintentionally

Hybrid View

  1. #1
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Locking cells unintentionally

    I too have been unable to re-create this problem - but that does not mean that it cannot happen under certain circumstances or in a different version of Excel

    One option would be a macro to auto-run whenever the values in required "unlocked" cells are amended
    - this procedure unlocks required ranges any time any one of those cells is amended
    Place in sheet module:
    Const LockedCells = "C4:C8,F8:F12,I7:I11"
    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim r As Range: Set r = Range(LockedCells)
        If Not Intersect(r, Target) Is Nothing Then
            Me.Unprotect "password"
                r.Locked = False
            Me.Protect "password"
        End If
    End Sub
    It unlocks all the cells that should be unlocked

    If you do not know the cause of the changes, you could do the same when any of the "unlocked" cells are selected
    Last edited by kev_; 02-22-2018 at 01:23 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

+ 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] Locking Cells without locking worksheet
    By navialivad in forum Excel General
    Replies: 5
    Last Post: 11-24-2014, 12:44 PM
  2. Locking specific cells eventually changing to locking all cells
    By davidingilbert in forum Excel General
    Replies: 1
    Last Post: 03-19-2013, 06:50 PM
  3. VBA code affecting header unintentionally
    By sk8shorty01 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2011, 12:39 PM
  4. Help with macro, automatical locking cells when excel is closed but only locking 1 sh
    By snoopy1461 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2011, 11:29 AM
  5. Replies: 1
    Last Post: 07-21-2006, 11:05 AM
  6. SheetChange fire UDF unintentionally
    By Peter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2006, 10:15 AM
  7. unintentionally changing SS
    By lil'bit in forum Excel General
    Replies: 6
    Last Post: 11-12-2005, 03:17 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