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
>
|