+ Reply to Thread
Results 1 to 7 of 7

Changing locked cells and colors on a protected sheet

  1. #1
    Registered User
    Join Date
    11-08-2012
    Location
    Silver Spring, MD
    MS-Off Ver
    Excel 2010
    Posts
    23

    Changing locked cells and colors on a protected sheet

    Hi, This macro does almost exactly what I need to do but it only works on sheet 1 and a single range (a8 to b20) .

    Can you help me to adjust it so it will work for multiple sheets ( sheet 2,3, etc) and multiple ranges on a single sheet.

    The ranges will be different for each sheet.

    Thank you very much.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Changing locked cells and colors on a protected sheet

    Please Login or Register  to view this content.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    11-08-2012
    Location
    Silver Spring, MD
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Changing locked cells and colors on a protected sheet

    natefarm,
    You are a genius and a nice person. thanks for your generous assistance.

  4. #4
    Registered User
    Join Date
    11-08-2012
    Location
    Silver Spring, MD
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Changing locked cells and colors on a protected sheet

    Nate farm,
    You are still a genius and a nice person but I got an error message.
    Error #91- Object variable or with block variable not set. I have no idea what that means . can you look at where it stopped and tell me what to do next ? i would appreciate it.

    It stopped at ws.unprotect "9273" . "9273" is the password
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Changing locked cells and colors on a protected sheet

    I ran into the same thing initially. You need to move the variable definitions for ws and rng back outside of the subroutines like I had them so the scope encompases both subroutines. The way you have it, the ws in ResetColorIndex is a different variable from the one in Protect, so it doesn't know what sheet you're talking about.

  6. #6
    Registered User
    Join Date
    11-08-2012
    Location
    Silver Spring, MD
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Changing locked cells and colors on a protected sheet

    WORKS LIKE A CHAMP !! Thanks a million.

  7. #7
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Changing locked cells and colors on a protected sheet

    No genius, but thanks anyway! Glad it worked!

+ 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] Still move locked cells in a protected sheet.
    By Dinus in forum Excel General
    Replies: 2
    Last Post: 11-26-2013, 06:53 PM
  2. Use Auto Filter on Protected Sheet with Locked Cells
    By lsargent in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-28-2013, 04:14 AM
  3. Protected Sheet and Locked Cells Compromised!
    By Winon in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-04-2012, 10:15 AM
  4. No Selection of Locked Cells on Protected Sheet
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2011, 11:29 AM
  5. [SOLVED] Still can select locked cells in protected sheet
    By Andy in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 10-29-2005, 03:05 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