Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Temporarily highlighting related cells

Can anyone tell me how you can select, for example, cell B5 and it
temporarily highlights in red the whole of, for example, cell D10?
The colouring needs to disappear when the cell is no longer selected.
This needs to apply to a number of cells with different references, so
when C5 is selected, cell D11 should be temporarily coloured red; cell
D5 is selected, cell D12 is highlighted.

This is to enable me to click on a network patch-panel port number and
it immediately shows to which switch port number it is connected.
This information is updated manually, so once the references are in
they should not need to be changed.

Anyone?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Temporarily highlighting related cells

You could use a Worksheet.selectionchange event to do this for the worksheet
in question

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Set myRange = Range("C5:C6")
If Not Intersect(Target, myRange) Is Nothing Then
Set r = Target.Offset(6, 1)
r.Interior.ColorIndex = 3
Else
Cells.Interior.ColorIndex = 2
End If

End Sub

If you select either C5 or C6 it will change the corresponding cell
background to RED. If you select any other cell, it will change the
background to WHITE

" wrote:

Can anyone tell me how you can select, for example, cell B5 and it
temporarily highlights in red the whole of, for example, cell D10?
The colouring needs to disappear when the cell is no longer selected.
This needs to apply to a number of cells with different references, so
when C5 is selected, cell D11 should be temporarily coloured red; cell
D5 is selected, cell D12 is highlighted.

This is to enable me to click on a network patch-panel port number and
it immediately shows to which switch port number it is connected.
This information is updated manually, so once the references are in
they should not need to be changed.

Anyone?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Temporarily highlighting related cells

Try this corrected version

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Set myRange = Range("C5:C6")
If Target.Count < 1 Then Exit Sub
If Not Intersect(Target, myRange) Is Nothing Then
Set r = Target.Offset(6, 1)
r.Interior.ColorIndex = 3
Else
Cells.Interior.ColorIndex = xlNone
End If

End Sub


" wrote:

Can anyone tell me how you can select, for example, cell B5 and it
temporarily highlights in red the whole of, for example, cell D10?
The colouring needs to disappear when the cell is no longer selected.
This needs to apply to a number of cells with different references, so
when C5 is selected, cell D11 should be temporarily coloured red; cell
D5 is selected, cell D12 is highlighted.

This is to enable me to click on a network patch-panel port number and
it immediately shows to which switch port number it is connected.
This information is updated manually, so once the references are in
they should not need to be changed.

Anyone?


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
Temporarily Disable Autocorrect Sloth Excel Discussion (Misc queries) 5 February 7th 07 04:24 PM
Count dollars in related cells My View Excel Discussion (Misc queries) 10 August 20th 06 12:35 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
COUNTIF temporarily missed some cells dstx Excel Worksheet Functions 0 July 18th 05 08:42 PM
Search a worksheet and add related cells izbryte Excel Worksheet Functions 1 November 22nd 04 09:57 PM


All times are GMT +1. The time now is 06:07 PM.

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"