+ Reply to Thread
Results 1 to 2 of 2

Prevent multiple cells selection & Lock Cell

Hybrid View

  1. #1
    Registered User
    Join Date
    06-08-2008
    Posts
    36

    Prevent multiple cells selection & Lock Cell

    Hi,

    I have two questions.

    1) Is it possible to prevent the user from selecting multiple cells? I only allow the user to select 1 cell at one time.

    2) I have protected some cells which I do not wish the user to edit. Is there a way that I can even prevent the user to select those particular cells?

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    For the protected cells when protecting you a list of options one of which is to allow users to select locked cells, so you need to make sure all other cells are unlocked (Ctrl+A then right click, format, protection, uncheck the locked box, then lock the individual cells you want to protect) as locking cells only works when a sheet is protected.

    The select only one cell can be cured like this:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Cells.Count > 1 Then
    MsgBox "Please select only one cell", vbOKOnly, "Multiple cell detection"
    Range("A1").Select
    End If
    End Sub
    put this in the worksheet code module (right click worksheet tab, view code and paste in)
    Not all forums are the same - seek and you shall find

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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