change row colour when cell is selected for ease

j4ymf

Well-known Member
Joined
Apr 28, 2003
Messages
541
Hello

I have a sheet but in struggling to see if I'm on the correct row when im filling it in
Can you change the row colour when a cell is selected?


ie: if I select any thing between G21:AE21 I can get A21:E21 to change colour
But if nothing is selected then don't change anything

Hope ive explained it easy enough

Jay
 

shina67

Board Regular
Joined
Sep 18, 2014
Messages
64
Here are the steps to highlight the active row.

Select the data you want to highlight.

Go to the Home tab.
Click on Conditional Formatting and then click on New Rule.
In the New Formatting Rule dialog box, select “Use a formula to determine which cells to format”.
In the Rule Description field, enter the formula: =CELL(“row”)=ROW())
Click on the Format button and specify the formatting (the colour in which you want the row highlighted).
Click OK.
The above steps have taken care of highlighting the active row whenever there is a selection change event.

However, to make this work, you need to place a simple VBA code in the backend.


Here is the VBA code that you can copy and paste.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.CutCopyMode = False Then
Application.Calculate
End If
End Sub
 
Last edited:

Forum statistics

Threads
1,085,314
Messages
5,382,922
Members
401,808
Latest member
huyennhiteen9xx

Some videos you may like

This Week's Hot Topics

Top