Changing Font Color

  • Thread starter Thread starter Brad E
  • Start date Start date
B

Brad E

I have a password protected workbook. I keep getting
errors with either of the following lines.

Range("F8:F13").Font.ColorIndex = 3
Range("F8:F13").Font.Color = RGB (255,0,0)

This selection is currently white font, and upon running
the macro I would like to show it to the user (change the
font to red).

When I unprotect the workbook, the macro works fine.

TIA, Brad E.
 
Hi
you have to unprotect your worksheet in your macro and protect i again
afterwards. So something like
activesheet.unprotect password:="your password"
Range("F8:F13").Font.ColorIndex = 3
Range("F8:F13").Font.Color = RGB (255,0,0)
activesheet.protect password:="your password"
 
Activesheet.Unprotect password:="ABCD"
Range("F8:F13").Font.ColorIndex = 3
Activesheet.Protect password:="ABCD"

I am sure you mean worksheet level protection as workbook level protection
should have no effect.
 
Thanks, Tom. It was the worksheet and not the workbook
that I wanted to protect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top