Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Protected Worksheet & altering Cell Color.

Status
Not open for further replies.

KippH

IS-IT--Management
Jul 18, 2003
3
0
0
US
Trying to change some text & background color on a different worksheet, but having problems when the worksheet (Accounting Tracker) is protected. Trying to alter the interior color of the cell in a protected worksheet, but I keep getting RunTime Error 1004. The Strikethrough works great but when I want to change the interior color I get the error. I have UserInterfaceOnly:=True in the ThisWorksheet of my VB.

Script:

Private Sub CheckBox22_Click()
'Shipping/Billable
If CheckBox22.Value = True Then
CheckBox23 = False
End If
Worksheets("Accounting Tracker").Range("K57").Font.Strikethrough = False
Worksheets("Accounting Tracker").Range("K57").Interior.Color = RGB(255, 204, 153)

End Sub
Private Sub CheckBox23_Click()
'Shipping/NonBillable
If CheckBox23.Value = True Then
CheckBox22 = False
End If
Worksheets("Accounting Tracker").Range("K57").Font.Strikethrough = True
Worksheets("Accounting Tracker").Range("K57").Interior.Color = RGB(255, 0, 0)


What else can I do to resolve this without unprotecting the Worksheet.

Regards,
KippH
kipph@betzwood.com
 
KippH,

Insert worksheets("Accounting Tracker").Unprotect at the beginning of your code and worksheets("Accounting Tracker").Protect at the end.

:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Skip,

Works Great, but anyway to stop the flip screen effect that happens when you unprotect then protect???

Regards,
KippH
 
to stop the flip screen effect..."

Try...
Application.Screenupdating = False at the beginning and [/b]Application.Screenupdating = True[/b] at the end.

Does not have anything to do with Protect & Unprotect!

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top