+ Reply to Thread
Results 1 to 5 of 5

Allowing VBA to edit protected cells

  1. #1
    Registered User
    Join Date
    01-30-2014
    Location
    Brazil
    MS-Off Ver
    Excel 2016
    Posts
    46

    Allowing VBA to edit protected cells

    Hello everyone.
    I made a sheet to control some reports, and it works like this: you click a button ("Insert"), it opens a userform, you type everything there (date, serial number, client, city) and it place that info on the first row available. Then there's a "Clear Last Entry" button, and that's it.
    I would like to protect the whole sheet and only allow users to insert new entries via the "Insert" button.
    How can I do this? If I protect normally Excel won't allow the VBA code to write on cells.
    Thank you!

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Allowing VBA to edit protected cells

    Try in the begin of your code
    Please Login or Register  to view this content.
    and at the end of your code

    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    01-30-2014
    Location
    Brazil
    MS-Off Ver
    Excel 2016
    Posts
    46

    Re: Allowing VBA to edit protected cells

    Thank you Fotis1991.
    That still requires the user to type the password, right? Is there a way to do this via code?
    My goal is to prevent the user (in this case the secretary) of changing things by mistake.
    If not possible I guess your solution will work too.
    Thank you again!

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Allowing VBA to edit protected cells

    Quote Originally Posted by lucasar View Post
    Thank you Fotis1991.
    My goal is to prevent the user (in this case the secretary) of changing things by mistake.
    Thank you again!
    If you use this way your secretary will not be able to change anything by mistake..! She should have the intention to do this..and in this case you need a new secretary!!

  5. #5
    Registered User
    Join Date
    01-30-2014
    Location
    Brazil
    MS-Off Ver
    Excel 2016
    Posts
    46

    Re: Allowing VBA to edit protected cells

    Hahaha, I guess you are right, I'm overthinking it.
    Thank you very much!!

+ 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. [SOLVED] Spellcheck Macro in Protected Worksheet - allowing 'Edit Objects'
    By tigerbenn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2012, 10:48 AM
  2. Replies: 0
    Last Post: 04-21-2011, 11:09 AM
  3. Allowing user to select a cell but not edit it?
    By Falantar in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-26-2009, 09:18 AM
  4. [SOLVED] To Protect Excel documents and allowing only few cells to edit
    By DHANRAJ in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-29-2006, 10:20 AM
  5. Allowing hyperlinks an a protected sheet
    By Chris Ince in forum Excel General
    Replies: 2
    Last Post: 11-07-2005, 04:30 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