Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Highlighting a cell

Is there a way to highlight a cell (different color) when it's selected.
For example, cell A1 becomes yellow when selected? However, once I select a
different cell the new cell become yellow and A1 goes back to white.
Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Highlighting a cell

Hi
see: http://www.cpearson.com/excel/RowLiner.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Vlad" schrieb im Newsbeitrag
om...
Is there a way to highlight a cell (different color) when it's

selected.
For example, cell A1 becomes yellow when selected? However, once I

select a
different cell the new cell become yellow and A1 goes back to white.
Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Highlighting a cell

Vlad,

Here is one way that highlights the row and column of the activecell. Not in
your colours but you can adapt to suit

Private Sub WorkSheet_SelectionChange(ByVal Target As Range)

Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target.EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With

End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vlad" wrote in message
om...
Is there a way to highlight a cell (different color) when it's selected.
For example, cell A1 becomes yellow when selected? However, once I select

a
different cell the new cell become yellow and A1 goes back to white.
Thanks.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Highlighting a cell

Bob and Frank,
Thanks a lot. This is exactly what I was looking for.

"Bob Phillips" wrote in message
...
Vlad,

Here is one way that highlights the row and column of the activecell. Not

in
your colours but you can adapt to suit

Private Sub WorkSheet_SelectionChange(ByVal Target As Range)

Cells.FormatConditions.Delete
With Target.EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target.EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 35
End With
With Target
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With

End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Vlad" wrote in message
om...
Is there a way to highlight a cell (different color) when it's selected.
For example, cell A1 becomes yellow when selected? However, once I

select
a
different cell the new cell become yellow and A1 goes back to white.
Thanks.






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
highlighting cell ganga Excel Discussion (Misc queries) 1 July 21st 09 10:01 PM
Highlighting a cell jlojones821 Excel Discussion (Misc queries) 6 July 14th 08 06:53 PM
Highlighting cell Orlando Excel Discussion (Misc queries) 2 September 25th 07 11:07 PM
Highlighting A Cell Coltsfan Excel Discussion (Misc queries) 1 September 19th 05 10:24 PM
Highlighting blanks via GO TO SPECIAL is not highlighting blank cells - HELP, I'm totally stuck. Jamie Furlong Excel Discussion (Misc queries) 6 August 28th 05 09:27 PM


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

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

About Us

"It's about Microsoft Excel"