Text color change in a cell depend on the cursor position elsewher

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Excel.
I want either the background color or the text color of a cell, or cells, to
change when the cursor is in a particular position.

e.g. The background/text color change for the far left cell of a row when
the cursor is anywhere in that row.
 
Hi!

Two things:

1. You can get a cell to change colour with a VBA routine such as:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
r = Target.Row
Cells(r, 1).Interior.ColorIndex = 6
End Sub

This paints the first cell in the row yellow.

But you'll need to give some thought as to whether/how you will dea
with moving off that row. Does the cell stay yellow or does it rever
to its colour before the change?

2. Excel2003 does a handsome job of lighting up the row numbers an
column letters in pretty orange so you know which row & column you
active cell is in.

Note use of "active cell" not cursor: moving the cursor withou
clicking won't change anything. VBA isn't into the MouseOver event
which you find in VB6 for example.

Al
 
Back
Top