+ Reply to Thread
Results 1 to 3 of 3

how can I lock cell colors but not contents

  1. #1
    Registered User
    Join Date
    05-18-2020
    Location
    Birmingham, AL USA
    MS-Off Ver
    2016
    Posts
    3

    how can I lock cell colors but not contents

    Hi,

    I am making a request form in Excel. People I work with need to fill out the form and email it to me so I can pull samples for them. I want every other row of a portion of the form to alternate colors.

    The problem I am running into is that when the users fill out the form, they move cells or rows around and screw up the alternating colors. I have looked for and found ways to lock a cells content but what I really need is the ability to lock the formatting of the cells without locking the contents.

    I've attached an example of the worksheet and a common problem that arises when users fill the form.

    Thank you!

  2. #2
    Spammer
    Join Date
    10-23-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003, Office 365
    Posts
    1,237

    Re: how can I lock cell colors but not contents

    You could try;

    Select the cells you want the format protected for.

    Format Cells>Protection. Uncheck the locked checkbox.

    Then Tools>Protection>Protect Sheet. Check Select Locked Cells and Edit Objects. Uncheck Format Cells

    This won't stop them copying and pasting stuff to screw up your formatting. You could try to educate them just to paste values?

    You could use vba too to ensure the colours remain as you want them, but (I suppose) you would need to post this query in the other section of the forum.
    Last edited by Croweater; 05-18-2020 at 08:50 PM.

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: how can I lock cell colors but not contents

    Hi Stan,

    One way to do what you want is to do all data entry using a UserForm. The user would press and 'Update Data' CommandButton on the UserForm to transfer the data from the Spreadsheet to the UserForm. The CommandButton code would unlock protection, put the data in the worksheet, and lock the data (and formatting).

    This requires a lot of work, but the end product is relatively secure, and lends itself to selective data entry through ComboBoxes, ListBoxes, CheckBoxes, OptionButtons on the UserForm which can restrict user choices when necessary. It also can highlight errors when user data entry is incomplete and/or incorrect.

    See the file associated with post #7 in the following thread for a simple UserForm example: https://www.excelforum.com/excel-pro...n-to-work.html

    The code in Module1 opens the UserForm (change to modeless for easier viewing and inspection) and the UserForm module.

    Lewis

+ 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. Replies: 5
    Last Post: 07-16-2014, 07:46 AM
  2. Replies: 1
    Last Post: 09-12-2013, 10:38 PM
  3. How to Lock/Unlock a Cell Based on the Contents of Another Cell?
    By bbright1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2013, 11:20 AM
  4. Replies: 1
    Last Post: 08-20-2012, 10:36 PM
  5. Fill cells with different colors based on different cell contents
    By mdeibel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2010, 10:09 AM
  6. Lock row based on cell contents
    By TheRetroChief in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-27-2008, 10:44 AM
  7. [SOLVED] Can I lock cell contents after current date is past?
    By Excel User Greg in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-16-2006, 02:50 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