View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Tom Hutchins Tom Hutchins is offline
external usenet poster
 
Posts: 1,069
Default Active cell with a "crosshair" indicator ?

Here is one way to do that - including a way to turn the highlighting on or
off. In the code module for each worksheet where you want this to happen,
paste this code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Call HiliteCells(Target)
End Sub

In a VBA module in the same workbook, paste this code:

Public NotNow As Boolean

Public Sub HiliteOn()
NotNow = False
End Sub

Public Sub HiliteOff()
NotNow = True
Cells.Interior.ColorIndex = xlColorIndexNone
End Sub

Public Sub HiliteCells(Target As Range)
If NotNow = False Then
Cells.Interior.ColorIndex = xlColorIndexNone
Target.EntireRow.Interior.ColorIndex = 36
Target.EntireColumn.Interior.ColorIndex = 36
End If
End Sub

(ColorIndex 36 is light yellow. Change to whatever you like).

To start highlighting on that worksheet, run the HiliteOn macro. To stop it,
run the HiliteOff macro. These could be assigned to toolbar buttons.

Hope this helps,

Hutch

"KarenY" wrote:

Hi, could anybody please help -
if I put the cursor on an active cell on a spreadsheet, I want the
corresponding row and column being highlighted (i.e. like a crosshair) - how
do I do that ?

appreciate your answer,
thanks
Karen