Results 1 to 4 of 4

Thread: Protect only some cells on an Excel spreadsheet *RESOLVED*

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Simon Caiger's Avatar
    Join Date
    Aug 2000
    Location
    Rugby, England
    Posts
    377

    Protect only some cells on an Excel spreadsheet *RESOLVED*

    Hi,
    Is it possible to protect just certain cells on an Excel spreadsheet?
    I need to prevent the user from accidentally entering data into certain columns unless they have entered a password.
    I'm OK with the password entry bit.
    The code I have so far is:
    VB Code:
    1. Private Sub cmdLockA_Click()
    2.  
    3.     Sheet1.Range("A:A").Locked = True
    4.     Sheet1.Protect
    5.    
    6. End Sub
    7.  
    8. Private Sub cmdUnlockA_Click()
    9.  
    10.     frmPasswordColumnA.Show
    11.     If sColumAPasswordEntered = "Sossij" Then
    12.         Sheet1.Unprotect
    13.         Sheet1.Range("A:A").Locked = False
    14.     End If
    15.    
    16. End Sub
    The test code above is supposed to just prevent data entry to column A.
    Unfortunately, it seems to protect the whole sheet.

    Any help would be appreciated.
    Last edited by Simon Caiger; Feb 27th, 2004 at 09:33 AM.
    Simon Caiger

    Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width