View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Temporary formatting of cell with focus

Ricter

Copy this to a General Module and run it.

Sub ListColorIndexes()
Dim Ndx As Long
Sheets.Add
For Ndx = 1 To 56
Cells(Ndx, 1).Interior.ColorIndex = Ndx
Cells(Ndx, 2).Value = Hex(ThisWorkbook.Colors(Ndx))
Cells(Ndx, 3).Value = Ndx
Next Ndx
End Sub

Note: if you have modified any colors, you will see discrepancies.


Gord Dibben MS Excel MVP

On Wed, 30 Aug 2006 12:42:02 -0700, Ricter
wrote:

That works, student of Gary, thanks. One more question, is there a pallet
somewhere I can look at to find those colorindexes? 46 is orange, on my
monitor anyway...

Ricter



"Gary''s Student" wrote:

If by focus you mean select, then try this:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
Target.Interior.ColorIndex = 46
End Sub

put this in worksheet code, not a standard module.
--
Gary''s Student


"Ricter" wrote:

How would one go about setting up a sheet where any cell with the focus would
have, say, a red background?