Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Selection highlight color

hi,

When cells are selected a blue color transparent color appears in the
selection. Is it possible to change the color programatically?

bye
Abhilash


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Selection highlight color

Hi Abhilash,

news.microsoft.com wrote:
When cells are selected a blue color transparent color appears in the
selection. Is it possible to change the color programatically?


You could do this by placing code similar to the following in the
ThisWorkbook module:

Private rngOld As Range

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)
If Not rngOld Is Nothing Then rngOld.Interior.ColorIndex = 0
Set rngOld = Selection
rngOld.Interior.Color = RGB(255, 0, 0)
ActiveCell.Interior.ColorIndex = 0
End Sub

As written, this will "overwrite" any fill colors your cells had prior to
being selected. You could use a static array to track the colors, then set
them back to the originals instead of setting colorindex=0 if you want.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Selection highlight color

Hello,

Well i dont want to change the fill colours of the cell. Thanks for your
response... Any other approach available?

Regards,
Abhilash

"Jake Marx" wrote in message
...
Hi Abhilash,

news.microsoft.com wrote:
When cells are selected a blue color transparent color appears in the
selection. Is it possible to change the color programatically?


You could do this by placing code similar to the following in the
ThisWorkbook module:

Private rngOld As Range

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)
If Not rngOld Is Nothing Then rngOld.Interior.ColorIndex = 0
Set rngOld = Selection
rngOld.Interior.Color = RGB(255, 0, 0)
ActiveCell.Interior.ColorIndex = 0
End Sub

As written, this will "overwrite" any fill colors your cells had prior to
being selected. You could use a static array to track the colors, then
set them back to the originals instead of setting colorindex=0 if you
want.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]



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
How can I darken the cell selection highlight color JBIBelt Excel Discussion (Misc queries) 3 April 29th 08 04:53 PM
Cell selection highlight colour Avril S Excel Worksheet Functions 4 March 31st 08 09:29 AM
Cell Selection Highlight garwayne Excel Discussion (Misc queries) 0 January 16th 07 06:37 PM
Highlight a selection from a menu, urgent! aiyer[_58_] Excel Programming 0 September 1st 04 02:54 PM
Highlight the selection! aiyer[_19_] Excel Programming 1 May 11th 04 09:04 PM


All times are GMT +1. The time now is 09:15 PM.

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"