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!

Help with color.... 1

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
I've tried changing the number in bold below and it only seem to take specific number, is there a pre-set number that are associated with color??

Oh by the way, this litte code snip highlights a cell in excel when selected with the keyboard and or mouse.

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Static OldCell As Range

If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = xlColorIndexNone
End If

Target.Interior.ColorIndex = 20

Set OldCell = Target


End Sub

"The reward of one duty done is the power to fulfill another"
<%
Jr_Clown@Yahoo.com
%>
 
according to the Excel help file, you can set the colorindex property to xlColorIndexNone, xlColorIndexAutomatic or to any integer value from 1 to 56 inclusive
 
Very nice JustinEzequiel. Thanks dude. Tony
:cool:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top