+ Reply to Thread
Results 1 to 6 of 6

Prompt password before editing an cell

Hybrid View

  1. #1
    Registered User
    Join Date
    10-17-2014
    Location
    Montross, VA
    MS-Off Ver
    Ms 2007
    Posts
    5

    Prompt password before editing an cell

    Hi,
    I am trying to make a spreadsheet that will be shared but i want the user to enter data only and cannot edit it without a password to protect the data in the cell. I have a code that works very well in Column C but i need it work also in Column A. The code is below, how can i make it work also in Column A.
    Thanks so much

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Cells.Count > 1 Then Exit Sub
    'The 3 represents column C, change to suit
    If Target.Column = 3 And Target.Value <> "" Then
    response = InputBox("This field is now protected. Enter password to edit", "Due Date")
    'The password MyPass can be what you want and is case sensitive
    If response <> "MyPass" Then Target.Offset(, 1).Select
    End If
    End Sub

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,809

    Re: Prompt password before editing an cell

    If (Target.Column = 1 Or Target.Column = 3) And Target.Value <> "" Then

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-17-2014
    Location
    Montross, VA
    MS-Off Ver
    Ms 2007
    Posts
    5

    Re: Prompt password before editing an cell

    Thanks for your response. I am a dummy to writing the code. Please help me again. Do I add this to the code at the end??

  4. #4
    Registered User
    Join Date
    10-17-2014
    Location
    Montross, VA
    MS-Off Ver
    Ms 2007
    Posts
    5

    Re: Prompt password before editing an cell

    I finally figured it out. And it works perfectly!!! It was so obvious. Thank you sooooo Much. Have a good evening

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,809

    Re: Prompt password before editing an cell

    You're welcome. Thanks for the rep.


    Please note that, to comply with Forum rules, you need to add Code Tags around your code excerpt in Post #1. Can I suggest that you take a few moments to read the Forum rules. Thanks.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  6. #6
    Registered User
    Join Date
    10-17-2014
    Location
    Montross, VA
    MS-Off Ver
    Ms 2007
    Posts
    5

    Re: Prompt password before editing an cell

    Thanks. I will read the forum rules.

+ 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. Prompt password when edit the cell
    By vaibhavch in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-30-2014, 07:03 AM
  2. Password prompt only when edit the cell
    By vaibhavch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2014, 07:02 AM
  3. VBA code that bypass Password prompt for every workbook with one master password
    By pwnyadav007 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2014, 01:45 AM
  4. [SOLVED] Password Prompt
    By Noel in forum Excel General
    Replies: 0
    Last Post: 05-18-2005, 03:06 PM
  5. [SOLVED] Password Prompt
    By LuhElle in forum Excel General
    Replies: 2
    Last Post: 03-08-2005, 08:06 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