+ Reply to Thread
Results 1 to 8 of 8

Protecting a Userform

  1. #1
    Registered User
    Join Date
    03-08-2018
    Location
    IL
    MS-Off Ver
    2013
    Posts
    5

    Protecting a Userform

    I have created a userform for data entry and would like to protect the data entered from the sheet so it forces the user to use the edit cmd button I have in place and be unable to delete rows or manually change data. Is there anyway to do this?

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Protecting a Userform

    Have you tried protecting the worksheet ?
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    03-08-2018
    Location
    IL
    MS-Off Ver
    2013
    Posts
    5

    Re: Protecting a Userform

    Yes, protecting the worksheet gives runtime errors in VBA saying I need to unlock the sheet to make changes.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Protecting a Userform

    Put
    Please Login or Register  to view this content.
    at the top of your code and
    Please Login or Register  to view this content.
    at the end of your code.

  5. #5
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,241

    Re: Protecting a Userform

    In workbook open using
    Sheets("name of sheet").protect "pas",userInterfaceonly := true
    "ThankyouFor Attention * And Your Help!!"

  6. #6
    Registered User
    Join Date
    03-08-2018
    Location
    IL
    MS-Off Ver
    2013
    Posts
    5
    Quote Originally Posted by daboho View Post
    In workbook open using
    Sheets("name of sheet").protect "pas",userInterfaceonly := true
    Thanks this worked but I added Workbook_Open() so it would run every time the ws is opened.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Protecting a Userform

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  8. #8
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,241

    Re: Protecting a Userform

    Run in worksheet_activate

+ 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. Protecting cells upon data entry and not protecting the sheet.
    By Acousticlife81 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2017, 10:37 AM
  2. Protecting a cell after data entry without protecting sheet
    By Acousticlife81 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-05-2017, 12:58 PM
  3. Protecting row.count - 1 when inserting from userform
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-09-2012, 06:01 AM
  4. Protecting cells - Input through a UserForm
    By sgp in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-13-2011, 02:43 AM
  5. Need Protecting/locking of headers from overwrite by userform.
    By rocki in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2008, 06:52 PM
  6. Password protecting UserForm?
    By LiamPotter in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-21-2008, 04:28 AM
  7. protecting userform
    By walid66 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-11-2007, 03:18 AM

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