+ Reply to Thread
Results 1 to 5 of 5

How to enable font color on protected worksheet?

  1. #1
    dlterry
    Guest

    How to enable font color on protected worksheet?

    How do I enable the changing of font color tool and still protect a worksheet
    in Excel 2000? Protection is necessary for formulas in other areas of the
    worksheet, but we need to be able to chnge the font color without
    unprotecting the worksheet

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    You can select "Format Cells" as an option in the Protect Sheet dialog box. Note that this will also allow changing Font, font size, fill color, etc. (anything that can be done in the Format Cells option).

    To protect against all but font color would require VBA code. That code would unprotect the sheet, change the color and reprotect the sheet.

    HTH
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Dave Peterson
    Guest

    Re: How to enable font color on protected worksheet?

    Maybe you could provide a macro that would unprotect the worksheet, change the
    color, then reprotect the worksheet.

    dlterry wrote:
    >
    > How do I enable the changing of font color tool and still protect a worksheet
    > in Excel 2000? Protection is necessary for formulas in other areas of the
    > worksheet, but we need to be able to chnge the font color without
    > unprotecting the worksheet


    --

    Dave Peterson

  4. #4
    dlterry
    Guest

    Re: How to enable font color on protected worksheet?

    I tried make a macro forthis, but it won't work. We have multiple users and
    the workbook is to assign order numbers from. I cannot give the password to
    everyone. The macro makes you input the password. We can't share the
    workbook either because if two people were trying to get the next order
    number, they would be duplicated. The pain that can cause is greater as it
    involves our corporate people in addition to ourselves. We are in two
    different cities so our instant communications can be difficult.

    I'm not very good on Excel so maybe there is a trick to creating a macro
    that will furnish the password that I don't know about. (So others won't
    know what it is) Are there any other suggestions?

    "Dave Peterson" wrote:

    > Maybe you could provide a macro that would unprotect the worksheet, change the
    > color, then reprotect the worksheet.
    >
    > dlterry wrote:
    > >
    > > How do I enable the changing of font color tool and still protect a worksheet
    > > in Excel 2000? Protection is necessary for formulas in other areas of the
    > > worksheet, but we need to be able to chnge the font color without
    > > unprotecting the worksheet

    >
    > --
    >
    > Dave Peterson
    >


  5. #5
    Dave Peterson
    Guest

    Re: How to enable font color on protected worksheet?

    I meant that the macro itself should supply the password.

    But if you meant that your workbook is shared (via tools|Share workbook), then
    my suggestion won't work. Nothing can change the worksheet protection (turn it
    on or turn it off) in a shared workbook.

    If the workbook isn't shared, how about trying this out on a test copy:

    Rightclick on the worksheet tab that should have this behavior. Select view
    code. Paste this in.

    Adjust this line to specify the range that should be able to be changed:

    Set myRng = Me.Range("a:a,b3:g9,d8")


    I put two lines that change colors--the top one is commented out (the leading
    apostrophe). The second one is "real".

    'Application.Dialogs(xlDialogPatterns).Show
    Application.Dialogs(xlDialogActiveCellFont).Show

    The commented line shows the dialog for Fill color. The "real" one pops the
    dialog for Font.

    And notice that the password is buried in the code (twice--once to unprotect and
    once to protect). Change that password to what you want.

    And to keep prying eyes from looking at your code, you'll want to protect the
    project (the VBA portion).

    Inside the VBE, (with your project selected),
    click on Tools|VBAProject Properties|Protection tab

    Give it a nice memorable password.



    Option Explicit
    Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
    Cancel As Boolean)

    Dim myRng As Range
    Set myRng = Me.Range("a:a,b3:g9,d8")

    If Intersect(myRng, Target) Is Nothing Then Exit Sub

    Cancel = True 'stop normal rightclick menu from showing

    On Error GoTo errHandler:
    Me.Unprotect Password:="hi"
    'Application.Dialogs(xlDialogPatterns).Show
    Application.Dialogs(xlDialogActiveCellFont).Show

    errHandler:
    Me.Protect Password:="hi"

    End Sub

    ========
    And you may not know it, but worksheet passwords (and workbook passwords) are
    not very difficult to break. Protecting formulas from being overwritten by
    mistake is a very good use of protection (as opposed to keeping things
    private/secret).




    dlterry wrote:
    >
    > I tried make a macro forthis, but it won't work. We have multiple users and
    > the workbook is to assign order numbers from. I cannot give the password to
    > everyone. The macro makes you input the password. We can't share the
    > workbook either because if two people were trying to get the next order
    > number, they would be duplicated. The pain that can cause is greater as it
    > involves our corporate people in addition to ourselves. We are in two
    > different cities so our instant communications can be difficult.
    >
    > I'm not very good on Excel so maybe there is a trick to creating a macro
    > that will furnish the password that I don't know about. (So others won't
    > know what it is) Are there any other suggestions?
    >
    > "Dave Peterson" wrote:
    >
    > > Maybe you could provide a macro that would unprotect the worksheet, change the
    > > color, then reprotect the worksheet.
    > >
    > > dlterry wrote:
    > > >
    > > > How do I enable the changing of font color tool and still protect a worksheet
    > > > in Excel 2000? Protection is necessary for formulas in other areas of the
    > > > worksheet, but we need to be able to chnge the font color without
    > > > unprotecting the worksheet

    > >
    > > --
    > >
    > > Dave Peterson
    > >


    --

    Dave Peterson

+ 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