Sheet protection versus changing text color

Wil Moosa

Well-known Member
Joined
Aug 11, 2002
Messages
893
I protected a sheet so nobody can change formula on that sheet.

There is one cell -say A1- which I un-blocked so I still can write data here.

After writing the data in the cell I want to change the color of the text... and that's not possible because the sheet is protected.

Is there a way around this?
 
Tools|Protection|Protect sheet|
then underneath where it says password to protect sheet you have a whole lot of check box's and you just have to check FORMAT CELLS.

Brett

Are you using XP Brett? I no see this in xl 2000.

Edit: Yep, you are using XP, had a gander last night.
_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2002-12-12 17:00
 
Upvote 0
NateO; I like the smoke of EXCEllerating code too but... where do I place the code?

In a standard macro, in the sheet itself?

When I do put it in a macro I get all kind of error code and even the macro name looks funny; well that smokes too but is not thé idea though?

Is it the full code?
 
Upvote 0
On 2002-12-11 17:03, Wil Moosa wrote:
NateO; I like the smoke of EXCEllerating code too but... where do I place the code?

In a standard macro, in the sheet itself?

Howdy Wil, Standard module, all of it. This is it in it's entirety.
When I do put it in a macro I get all kind of error code and even the macro name looks funny; well that smokes too but is not thé idea though?

Oh yeah? Not I. Hmmm. You copied everything. You only run:

Sub ColorCell()

What version of Excel are you using. I suppose there's a few possibilities here, seems to run & gun in xl 2000/win 2000.

Edit: Seems like both of the api involved are xl '97 supported. I'm not sure what you've done at this point...

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2002-12-11 17:10
 
Upvote 0
Greassssse Lightning......

Got the baby running and indeed smoke and dirt everywhere.

NateO, always welcome to join for a ride.
This message was edited by Wil Moosa on 2002-12-12 13:19
 
Upvote 0
Smokin' Wil. So can I can tag along? :grin:

I ran into a different version of this, at Monsieur Laurent Longre's site, c'est magnifique.

I'd customize it in your case to look like:<pre>
Type udtCColor
lStructSize As Long
hwndOwner As Long
hInstance As Long
rgbResult As Long
lpCustColors As String
Flags As Long
lCustData As Long
lpfnHook As Long
lpTemplateName As Long
End Type

Declare Function ChooseColorA Lib "Comdlg32" _
(lpChooseColor As udtCColor) As Long

Declare Function FindWindowA Lib "User32" _
(ByVal lpClassName As Any, ByVal lpWindowName As String) As Long

Function SelColor(Code_RVB) As Boolean

Dim CColor As udtCColor
Dim CustColors As String * 16

With CColor
.lStructSize = 36
.hwndOwner = FindWindowA(0&, Application.Caption)
.lpCustColors = CustColors
.Flags = 2
End With

If ChooseColorA(CColor) = 0 Then Exit Function
Code_RVB = CColor.rgbResult
SelColor = True

End Function

Sub Test()
Dim Code_RVB As Long
If Not SelColor(Code_RVB) Then Exit Sub
Selection.Font.Color = Code_RVB
End Sub</pre>

Good stuff. Best with the dirt and smoke!

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2002-12-12 17:02
 
Upvote 0
I looked at it after some time again and it turned out that the palet did not show up under Win98. This is a known issue?
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top