+ Reply to Thread
Results 1 to 3 of 3

MAcro does not work when certain cells in a work sheet are protected

  1. #1
    Registered User
    Join Date
    09-15-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    27

    MAcro does not work when certain cells in a work sheet are protected

    Hi

    I have this vba code below which is meant to extract a work sheet from a file , paste special the values as they have links and formulas and save it in a path provided with a specific name .

    The macro works fine . However I need to protect certain cells as they have formulaes and the user at times inadvertently tend to delete them .

    Can someone please help me show a way in which I can run the macro even though cells are protected.

    Here is the code below
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 12-08-2012 at 05:49 AM. Reason: Added Code Tags

  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,420

    Re: MAcro does not work when certain cells in a work sheet are protected

    I usually find that the easiest way is to unprotect the sheet before the action and protect it again afterwards.

    That means the password will be visible in the code so, in turn, you need to password protect the VBA code so it cannot be (easily) accessed.


    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
    09-15-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: MAcro does not work when certain cells in a work sheet are protected

    Hey

    The ppl who are using this form will not be viewing the code at all. SO I am ok if the password appears in the vba code as they surely will not access it. Can you help modify the code please?

    Alternately, the reason why I need to password protect certain cells is because they contain formulas and the user inadvertently may delete or tamper with the formulas unknowingly , hence locking the cells. Is there a another way to avert this . as in is there any formula or way in which a prompt or pop up window appears on cells that contain a formula asking the user are you sure you want to modify this etc. Just thinking aloud here. Please throw in ideas if any,

    Thanks
    Unnati
    Thnks
    Unnati

+ 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