Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Temporary formatting of cell with focus

How would one go about setting up a sheet where any cell with the focus would
have, say, a red background?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Temporary formatting of cell with focus

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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Temporary formatting of cell with focus

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?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Temporary formatting of cell with focus

I don't know. I usually turn on the Macro Recorder and then color a cell. I
look at the generated code to get the value.
--
Gary's Student


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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 299
Default Temporary formatting of cell with focus

Try here

http://www.mvps.org/dmcritchie/excel...htm#colorindex




--


Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
(Remove ^^ from email)


"Ricter" wrote in message
...
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?





  #6   Report Post  
Posted to microsoft.public.excel.misc
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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting For A Cell Other Than The One With The Form Jim J. Excel Worksheet Functions 2 February 19th 06 07:11 PM
Transfer Cell Formatting for linked cells Scott Excel Discussion (Misc queries) 2 November 23rd 05 11:04 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
cell formatting problems jazzsax505 New Users to Excel 2 May 29th 05 10:30 PM
Trying to add conditional formatting to every other cell...GOING . trixiebme Excel Worksheet Functions 2 March 24th 05 01:55 PM


All times are GMT +1. The time now is 09:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"