+ Reply to Thread
Results 1 to 2 of 2

Protecting certain cells

Hybrid View

  1. #1
    William Spence
    Guest

    Protecting certain cells

    I am writing a program where i need to clear, and color certain cells,
    but want the user to have read only access on this particular page.
    When i all the cells i want locked and I protect the sheet, my program
    keeps getting stopped on the lines of code that clears, and colors
    these cells. How would i keep these cells protected but still be able
    to clear and color them.


  2. #2
    KL
    Guest

    Re: Protecting certain cells

    Hi William,

    You can just unprotect and protect the sheet within your macro, e.g.:

    Sub Test()
    Pass="YourPassword"
    Worksheets("Sheet1").Unprotect Pass
    'your code here
    Worksheets("Sheet1").Protect Pass
    End Sub

    Regards,
    KL


    "William Spence" <[email protected]> wrote in message
    news:[email protected]...
    >I am writing a program where i need to clear, and color certain cells,
    > but want the user to have read only access on this particular page.
    > When i all the cells i want locked and I protect the sheet, my program
    > keeps getting stopped on the lines of code that clears, and colors
    > these cells. How would i keep these cells protected but still be able
    > to clear and color them.
    >




+ 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