Highlight whole row as cursor moves (1 Viewer)

bulrush

Registered User.
Local time
Today, 09:29
Joined
Sep 1, 2009
Messages
209
Excel 2000 on Windows

I have a very wide spreadsheet, as such, I have to shrink it down to see more columns in the window. As my cursor moves around in the spreadsheet the row and column labels are bold. My old eyes would like the whole row to be highlighted with a certain color as the cursor moves because I have to check data in many columns in each row.

Is this possible? I didn't see anything like this in the Options window.

Thanks.

p.s. This is not a static highlight where I highlight the row, and click the Background Color button. This is a dynamic highlight to moves with my cursor.

Is there any way to enter the code once and have it work on any worksheet tab in the worksheet file?
 
Last edited:

chergh

blah
Local time
Today, 14:29
Joined
Jun 15, 2004
Messages
1,414
AFAIK you can't do this as there is no mouse over event to trigger the row highlighting.
 

HaHoBe

Locomotive Breath
Local time
Today, 15:29
Joined
Mar 1, 2002
Messages
233
Hi, bulrush,

please mind that code will clear all other colors, goes behind the worksheet:

Code:
Public mlngOldRow As Long

Private Sub Worksheet_Activate()
mlngOldRow = ActiveCell.Row
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If mlngOldRow > 0 Then Rows(mlngOldRow).Interior.ColorIndex = xlNone
With Target
    If .Row <> mlngOldRow Then
        .EntireRow.Interior.ColorIndex = 6
        mlngOldRow = .Row
    End If
End With
End Sub
Highlight is what I expect to be highlighing color number 1 (yellow).

Ciao,
Holger
 

bulrush

Registered User.
Local time
Today, 09:29
Joined
Sep 1, 2009
Messages
209
I used to have this code (I think) in my Personal.xls workbook, which means it affected all open spreadsheets. The code doesn't seem to work at all, when I pasted it into my Personal.xls workbook, which is opened every time I restart Excel.

I even tried restarting Excel. Got any clue how to make this work for all worksheets open?
 

HaHoBe

Locomotive Breath
Local time
Today, 15:29
Joined
Mar 1, 2002
Messages
233
Hi, bulrush,

I pretty much doubt that the code ever worked from the personal.xls for open workbooks due to the fact that the Worksheet-Events only works for the given sheets in the workbook where the code is located.

You can work around that by using Class programming and thus activating the code for any open workbooks and worksheets. Please have a look at Introduction To Classes by Chip Pearson or Control Events by Jan Karel Pieterse or rely on MSDN with Custom Classes and Objects (for Office XP).

HTH,
Holger
 

qafself

Registered User.
Local time
Today, 14:29
Joined
Nov 9, 2005
Messages
119
You could use conditional formatting to colour alternate rows - make reading across much easier
 

Darkewood

New member
Local time
Today, 14:29
Joined
Jan 29, 2014
Messages
1
Thank you, Thank you HaHoBe. This was exactly what I was searching for.
It all works perfectly until I protect the worksheet, so that locked cells can not be altered, I then get an error message when move the cursor & am asked to debug (something I know nothing about).
The worksheet contains both locked & unlocked cells and ranges with conditional formatting.
Any clue as to how to avoid the problem other than leaving unlocked?
 

Users who are viewing this thread

Top Bottom