Protecting a cell, but allowing the drop down list to work

4

I want to protect a cell that I have a drop down list in, but I still want the drop down list to work.

When I try to protect it, the user is not able to use the drop down list to select other items or macros.

I get this error message

"The cell or chart that you are trying to change is protected and therefore read-only. To modify a protected cell or chart, first remove protection using the Unprotected Sheet command (Review tab, Changes group). You may be prompted for a password."

johnnnieyy

Posted 2015-06-08T19:57:18.123

Reputation: 41

Answers

4

The dropdown is attached to the cell. That's where it stores the data. The validation will guarantee that the data is valid.

If you haven't already, make sure that the cell is not locked. Right-click the cell and click format cells and then go to the Protection tab. The Locked check box should be unchecked.

rfportilla

Posted 2015-06-08T19:57:18.123

Reputation: 425

Don't forget to mark it correct! ;-) – rfportilla – 2015-06-08T20:44:17.550

But you can easily paste data on that cell, if it is not protected – Firee – 2016-03-11T08:22:05.023

There's no choice. But, the validation will guarantee that the data is acceptable. – rfportilla – 2016-03-12T04:36:19.760

0

On my computer (PC running Excel 2010), the dropdown list itself actually seems to be attached to the cell immediately to the right. So if I want a dropdown list in A7, I have to unlock both A7 and B7.

This may be a bug, but it is a relatively simple fix.

Catherine

Posted 2015-06-08T19:57:18.123

Reputation: 1

0

In Protected sheets:

Paste below link in workbook

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

    Dim wsh As Variant
    For Each wsh In Worksheets(Array("Sheet1"))
        wsh.EnableOutlining = True
        wsh.Protect UserInterfaceOnly:=True, Password:="", _
            DrawingObjects:=False, _
    Contents:=True, _
    Scenarios:=True, _
    AllowFormattingCells:=False, _
    AllowFormattingColumns:=False, _
    AllowFormattingRows:=False, _
    AllowInsertingColumns:=False, _
    AllowInsertingRows:=False, _
    AllowInsertingHyperlinks:=False, _
    AllowDeletingColumns:=False, _
    AllowDeletingRows:=False, _
    AllowSorting:=False, _
    AllowFiltering:=False, _
    AllowUsingPivotTables:=False
    Next wsh

Dim Oldvalue As String
Dim Newvalue As String

On Error GoTo Exitsub
If Target.Address = "$C$2" Then 'As required
    If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
    GoTo Exitsub
    Else: If Target.Value = "" Then GoTo Exitsub Else
        Application.EnableEvents = False
        Newvalue = Target.Value
        Application.Undo
        Oldvalue = Target.Value
        If Oldvalue = "" Then
            Target.Value = Newvalue
        Else
            Target.Value = Oldvalue & ", " & Newvalue
        End If
    End If
End If


Exitsub:
Application.EnableEvents = True

End Sub

Raja Sekhar

Posted 2015-06-08T19:57:18.123

Reputation: 1

Welcome to Superuser! When giving an answer it is preferable to give some explanation as to WHY your answer is the one. This is especially true on old questions. Please consider editing your answer and explaining why it is the solution.

– Stephen Rauch – 2017-04-04T04:42:15.073