Howdy Wil, in xl 2000 you can apply font colour changes to locked and unlocked cells via vba. A quick way is:<pre>
activecell.font.colorindex = 3</pre>
You can't use Excel's built in dialog, Dialogs(161), which is dumb. But you can use the windows pallete, as below:<pre>
Private Declare Function ChooseColor Lib "comdlg32.dll" Alias _
"ChooseColorA" (pChoosecolor As ChooseColor) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Type ChooseColor
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 String
End Type
Private Function ShowColor() As Long
Dim ChooseColorStructure As ChooseColor
Dim Custcolor(16) As Long
Dim lReturn As Long
ChooseColorStructure.lStructSize = Len(ChooseColorStructure)
ChooseColorStructure.hwndOwner = FindWindow("XLMAIN", _
Application.Caption)
ChooseColorStructure.hInstance = 0
ChooseColorStructure.lpCustColors = StrConv(CustomColors, _
vbUnicode)
ChooseColorStructure.flags = 0
If ChooseColor(ChooseColorStructure)<> 0 Then
ShowColor = ChooseColorStructure.rgbResult
CustomColors = StrConv(ChooseColorStructure.lpCustColors, _
vbFromUnicode)
Else
ShowColor = -1
End If
End Function
Sub ColorCell()
ActiveCell.Font.Color = ShowColor
End Sub</pre>
Spotted this gem
here. Just tweaked the last piece to work on a font versus interior.
You can associate
ColorCell with a button with or just run it. Hope this helps.
_________________
Cheers,<font size=+2><font color="red">
Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2002-12-10 19:18