+ Reply to Thread
Results 1 to 5 of 5

How to permit VBA codes to work when cells are protected?

  1. #1
    Registered User
    Join Date
    10-01-2012
    Location
    North Bay, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    60

    How to permit VBA codes to work when cells are protected?

    Hello all,

    I was just wondering if it's possible to permit the Excel VBA codes that I have to work even when I protect certain cells in my workbook?

    As we speak, all my VBA codes work great but when I protect the sheet I receive an error when formula's are attempting to work... Any way of getting rid of this error and let the VBA code do its function when the multiple cells are protected within the workbook?

    Thanks in advance,

    Pat.

  2. #2
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: How to permit VBA codes to work when cells are protected?

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: How to permit VBA codes to work when cells are protected?

    also a good way to get simple functions like this is to use the record macro feature. start record, protect the sheet, unprotect the sheet, then stop record and you have your macros. take care!

  4. #4
    Registered User
    Join Date
    10-01-2012
    Location
    North Bay, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: How to permit VBA codes to work when cells are protected?

    The code you gave me,

    Does it unprotect all my cells that I have protected though? Like I still want those cells to be protected but to be able to permit my VBA codes to work..

    Thanks,

    Pat.

  5. #5
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: How to permit VBA codes to work when cells are protected?

    put the unprotect code at the top of your macro and the protect at the end. they way you had it set up before is the way it will put it back, it does not affect individual cells. only cells flagged as locked.

+ 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