PC Review


Reply
Thread Tools Rate Thread

Color Index for light yellow & Code Help?

 
 
Jim
Guest
Posts: n/a
 
      3rd Jul 2008
first)
what is the color index number for light yellow? im using Excel 2000 if it
matters. The color index chart in help sux. does anyone know where to get a
better index for the colors? thanks

Seccond)
I need to write a bit of code that only lets certain levels of access to
stamp. I have the code below. everything works untill the user enters "no" on
the MsgBox and doesnt have access to write to a certain range of cells (which
are colored light yellow). now what i want to do is if the user stamps on the
yellow cells but doesnt have enough of a security level to write to it then
it should erase whatever is in the cell. the main area im having problems
with is the line with
"Selection.Interior.ColorIndex = 6" any help would be great thanks.

===================Code===============================
response = MsgBox("Create new entry?", vbYesNo)

If response = 6 Then
If LoginCheck = True Then
If strUserAccess = deme Then
MsgBox "You Can Now Edit The Sheet."
ThisWorkbook.Worksheets("ElecCTRLSheet").Unprotect (sheetpwd)
Else
MsgBox "Write Access Denied."
Selection.Value = ""
ThisWorkbook.Worksheets("ElecCTRLSheet").Protect (sheetpwd)
End If
Else
Selection.Value = ""
End If

ElseIf response = 7 Then
If Selection.Interior.ColorIndex = 6 Then
If strUserAccess <> "deme" Then
Selection.Value = ""
MsgBox "Cannot Stamp Here."
End If
End If

End If

 
Reply With Quote
 
 
 
 
Jim
Guest
Posts: n/a
 
      3rd Jul 2008
when i say "stamp" i mean write to the sheet. sorry for the confusion

"Jim" wrote:

> first)
> what is the color index number for light yellow? im using Excel 2000 if it
> matters. The color index chart in help sux. does anyone know where to get a
> better index for the colors? thanks
>
> Seccond)
> I need to write a bit of code that only lets certain levels of access to
> stamp. I have the code below. everything works untill the user enters "no" on
> the MsgBox and doesnt have access to write to a certain range of cells (which
> are colored light yellow). now what i want to do is if the user stamps on the
> yellow cells but doesnt have enough of a security level to write to it then
> it should erase whatever is in the cell. the main area im having problems
> with is the line with
> "Selection.Interior.ColorIndex = 6" any help would be great thanks.
>
> ===================Code===============================
> response = MsgBox("Create new entry?", vbYesNo)
>
> If response = 6 Then
> If LoginCheck = True Then
> If strUserAccess = deme Then
> MsgBox "You Can Now Edit The Sheet."
> ThisWorkbook.Worksheets("ElecCTRLSheet").Unprotect (sheetpwd)
> Else
> MsgBox "Write Access Denied."
> Selection.Value = ""
> ThisWorkbook.Worksheets("ElecCTRLSheet").Protect (sheetpwd)
> End If
> Else
> Selection.Value = ""
> End If
>
> ElseIf response = 7 Then
> If Selection.Interior.ColorIndex = 6 Then
> If strUserAccess <> "deme" Then
> Selection.Value = ""
> MsgBox "Cannot Stamp Here."
> End If
> End If
>
> End If
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      3rd Jul 2008


Here is an enumerated list which you can add to a module and then use the
colour constant name.

Public Enum xlColorIndex
xlCIBlack = 1
xlCIWhite = 2
xlCIRed = 3
xlCIBrightGreen = 4
xlCIBlue = 5
xlCIYellow = 6
xlCIPink = 7
xlCITurquoise = 8
xlCIDarkRed = 9
xlCIGreen = 10
xlCIDarkBlue = 11
xlCIDarkYellow = 12
xlCIViolet = 13
xlCITeal = 14
xlCIGray25 = 15
xlCIGray50 = 16
xlCIPeriwinkle = 17
xlCIPlum = 18
xlCIIvory = 19
xlCILightTurquoise = 20
xlCIDarkPurple = 21
xlCICoral = 22
xlCIOceanBlue = 23
xlCIIceBlue = 24
'xlCIDarkBlue = 25
'xlCIPink = 26
'xlCIYellow = 27
'xlCITurquoise = 28
'xlCIViolet = 29
'xlCIDarkRed = 30
'xlCITeal = 31
'xlCIBlue = 32
xlCISkyBlue = 33
xlCILightGreen = 35
xlCILightYellow = 36
xlCIPaleBlue = 37
xlCIRose = 38
xlCILavender = 39
xlCITan = 40
xlCILightBlue = 41
xlCIAqua = 42
xlCILime = 43
xlCIGold = 44
xlCILightOrange = 45
xlCIOrange = 46
xlCIBlueGray = 47
xlCIGray40 = 48
xlCIDarkTeal = 49
xlCISeaGreen = 50
xlCIDarkGreen = 51
xlCIBrown = 53
xlCIIndigo = 55
xlCIGray80 = 56
End Enum



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Jim" <(E-Mail Removed)> wrote in message
news:8555EE5E-8C92-41B3-8397-(E-Mail Removed)...
> first)
> what is the color index number for light yellow? im using Excel 2000 if it
> matters. The color index chart in help sux. does anyone know where to get
> a
> better index for the colors? thanks
>
> Seccond)
> I need to write a bit of code that only lets certain levels of access to
> stamp. I have the code below. everything works untill the user enters "no"
> on
> the MsgBox and doesnt have access to write to a certain range of cells
> (which
> are colored light yellow). now what i want to do is if the user stamps on
> the
> yellow cells but doesnt have enough of a security level to write to it
> then
> it should erase whatever is in the cell. the main area im having problems
> with is the line with
> "Selection.Interior.ColorIndex = 6" any help would be great thanks.
>
> ===================Code===============================
> response = MsgBox("Create new entry?", vbYesNo)
>
> If response = 6 Then
> If LoginCheck = True Then
> If strUserAccess = deme Then
> MsgBox "You Can Now Edit The Sheet."
> ThisWorkbook.Worksheets("ElecCTRLSheet").Unprotect
> (sheetpwd)
> Else
> MsgBox "Write Access Denied."
> Selection.Value = ""
> ThisWorkbook.Worksheets("ElecCTRLSheet").Protect (sheetpwd)
> End If
> Else
> Selection.Value = ""
> End If
>
> ElseIf response = 7 Then
> If Selection.Interior.ColorIndex = 6 Then
> If strUserAccess <> "deme" Then
> Selection.Value = ""
> MsgBox "Cannot Stamp Here."
> End If
> End If
>
> End If
>



 
Reply With Quote
 
Jennifer
Guest
Posts: n/a
 
      3rd Jul 2008
Here is good link to color indexes:
http://www.mvps.org/dmcritchie/excel/colors.htm
 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      3rd Jul 2008
Sub MakeColorIndexChart()
for i = 0 to 56
cells(i+1,1).value = i
cells(i+1,2).Interior.ColorIndex = i
Next
End Sub

the color associated with a specific colorindex value is not locked.
Someone can change the color palette for that workbook.

--
Regards,
Tom Ogilvy



"Jim" wrote:

> first)
> what is the color index number for light yellow? im using Excel 2000 if it
> matters. The color index chart in help sux. does anyone know where to get a
> better index for the colors? thanks
>
> Seccond)
> I need to write a bit of code that only lets certain levels of access to
> stamp. I have the code below. everything works untill the user enters "no" on
> the MsgBox and doesnt have access to write to a certain range of cells (which
> are colored light yellow). now what i want to do is if the user stamps on the
> yellow cells but doesnt have enough of a security level to write to it then
> it should erase whatever is in the cell. the main area im having problems
> with is the line with
> "Selection.Interior.ColorIndex = 6" any help would be great thanks.
>
> ===================Code===============================
> response = MsgBox("Create new entry?", vbYesNo)
>
> If response = 6 Then
> If LoginCheck = True Then
> If strUserAccess = deme Then
> MsgBox "You Can Now Edit The Sheet."
> ThisWorkbook.Worksheets("ElecCTRLSheet").Unprotect (sheetpwd)
> Else
> MsgBox "Write Access Denied."
> Selection.Value = ""
> ThisWorkbook.Worksheets("ElecCTRLSheet").Protect (sheetpwd)
> End If
> Else
> Selection.Value = ""
> End If
>
> ElseIf response = 7 Then
> If Selection.Interior.ColorIndex = 6 Then
> If strUserAccess <> "deme" Then
> Selection.Value = ""
> MsgBox "Cannot Stamp Here."
> End If
> End If
>
> End If
>

 
Reply With Quote
 
Jim
Guest
Posts: n/a
 
      3rd Jul 2008
Thanks so much. thats all i needed #36!!! WOO HOO!

"Jim" wrote:

> first)
> what is the color index number for light yellow? im using Excel 2000 if it
> matters. The color index chart in help sux. does anyone know where to get a
> better index for the colors? thanks
>
> Seccond)
> I need to write a bit of code that only lets certain levels of access to
> stamp. I have the code below. everything works untill the user enters "no" on
> the MsgBox and doesnt have access to write to a certain range of cells (which
> are colored light yellow). now what i want to do is if the user stamps on the
> yellow cells but doesnt have enough of a security level to write to it then
> it should erase whatever is in the cell. the main area im having problems
> with is the line with
> "Selection.Interior.ColorIndex = 6" any help would be great thanks.
>
> ===================Code===============================
> response = MsgBox("Create new entry?", vbYesNo)
>
> If response = 6 Then
> If LoginCheck = True Then
> If strUserAccess = deme Then
> MsgBox "You Can Now Edit The Sheet."
> ThisWorkbook.Worksheets("ElecCTRLSheet").Unprotect (sheetpwd)
> Else
> MsgBox "Write Access Denied."
> Selection.Value = ""
> ThisWorkbook.Worksheets("ElecCTRLSheet").Protect (sheetpwd)
> End If
> Else
> Selection.Value = ""
> End If
>
> ElseIf response = 7 Then
> If Selection.Interior.ColorIndex = 6 Then
> If strUserAccess <> "deme" Then
> Selection.Value = ""
> MsgBox "Cannot Stamp Here."
> End If
> End If
>
> End If
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to replace the background color of all cells from light green to light blue? Claudia d'Amato Microsoft Excel Programming 5 15th Nov 2008 12:11 AM
How to replace the background color of all cells from light green to light blue? Claudia d'Amato Microsoft Excel Misc 1 14th Nov 2008 07:09 PM
RE: Color Index Code, is there any thing like that? Gary''s Student Microsoft Excel New Users 0 22nd May 2008 01:56 PM
the font defaults to light yellow =?Utf-8?B?bGQ=?= Microsoft Outlook Discussion 1 28th Oct 2005 02:50 AM
Power light blinking yellow detimes2 Computer Hardware 1 2nd Mar 2005 01:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:13 PM.