high-lite the active cell's row when mouse cursor is in plac

trillicomm

Board Regular
Joined
Feb 24, 2002
Messages
101
A file has thin row height so I can view many rows on the screen. But sometimes I get mixed up reading different cells of either the above or below ones of the active row (because of small text size, too). If someone can help me script an visible feature VBA macro to colorize the row background in light green and bold type the text from columns A to D, that'd be greatly appreciated. But the row has to return to the normal property when the mouse moves to another cell with respect to the row.

Thank you.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Yes.

Try this:

In the worksheet module

<pre>
Dim Pre As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Pre Is Nothing Then
If Target.Row <> Pre.Row Then
With Pre
.EntireRow.Interior.ColorIndex = -4142
.Font.Bold = False
End With
End If
End If
With Target
.EntireRow.Interior.ColorIndex = 36
Cells(.Row, 1).Resize(1, 4).Font.Bold = True
End With
Set Pre = Cells(Target.Row, 1).Resize(1, 4)
End Sub
</pre>
 
Upvote 0
Juan,

It works very well for single cell selection except multiple cells selection (by found that out by accident). Sorry about the instruction. Now I learn that there are three types of VBA locations: worksheet(s), thisworkbook, and modules, let alone the Personal.xls.

Thank you JP.

T.
 
Upvote 0
Hi

I have a very simple example of this here:
http://www.ozgrid.com/VBA/ExcelWorkbookEvents.htm
Scroll to the bottom and look at:
"Automatic Highlighting of Active Row"



_________________
Kind Regards
Dave Hawley
OzGrid Business Applications
Microsoft Excel/VBA Training
OzGrid.BusApp.170x45.gif

This message was edited by Dave Hawley on 2002-03-23 19:33
 
Upvote 0

Forum statistics

Threads
1,213,485
Messages
6,113,931
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top