Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Highlighting 'corresponding' cells

I have a table like the one below. Is it possible to highlight an
offset cell depending upon which cell is currently selected? In other
words, if I click on cell A1, can the background color of cell D1
change to say yellow. Conversely, if I click on cell D1 I would want
the background color of cell A1 to change. Any ideas? Thanks in
advance.

A B C D E F
1 a b c 1 2 3
2 d e f 4 5 6
3 g h i 7 8 9
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Highlighting 'corresponding' cells

You can use conditional formatting for this
example: Highlight a cell in column A of a table in A:E
select all the cells in column A then Format/Conditional
Formatting , change to ''Formula Is' and enter
=AND(CELL("ROW")=ROW(),CELL("COL")<=5)
seelct Patterns and choose a pale background color...OK
twice to close

Now go to the sheet's code page ( right click the tab to
get the menu & choose View code
add this
Private Sub Worksheet_SelectionChange(ByVal Target As _
Range)
Sheet1.Calculate
End Sub

Now, for any cell in the table, the corresponding cell in
A will be highlighted.

Now seelct column D in the table and add this 'formula is'
=AND(CELL("COL")=1,ROW()=CELL("ROW"))
choose another pattern

Now if a cell in the table first colun is selected, then
the cell in D for that row will also be hightlighted.


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I have a table like the one below. Is it possible to

highlight an
offset cell depending upon which cell is currently

selected? In other
words, if I click on cell A1, can the background color

of cell D1
change to say yellow. Conversely, if I click on cell D1

I would want
the background color of cell A1 to change. Any ideas?

Thanks in
advance.

A B C D E F
1 a b c 1 2 3
2 d e f 4 5 6
3 g h i 7 8 9
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Highlighting 'corresponding' cells

Thanks Patrick. That's beautiful!
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 do I add cells by highlighting them? Tim Excel Discussion (Misc queries) 2 September 7th 09 10:22 PM
Highlighting cells Martin Murray Excel Worksheet Functions 2 April 12th 08 04:07 AM
Highlighting Cells perezianda Excel Worksheet Functions 3 October 19th 06 11:39 PM
Highlighting Cells comotoman Excel Discussion (Misc queries) 2 September 26th 05 03:45 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 10:31 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"