Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to highlight entire / whole row while scrolling in Excel worksheet? 

If you have a large worksheet with multiple columns, it will be difficult for you to distinguish data on that row. In this case, you can highlight the whole row of active cell so that you can quickly and easily view the data in that row when you scroll down the horizontal scroll bar .This article, I will talk about some tricks for you to solve this problem.

Highlight whole row when scrolling with VBA code

Highlight whole row / column / row and column when scrolling with Kutools for Excel


Automatically highlight entire column, row or column and row of seleted cell or selection:

Kutools for Excel’s Reading Layout will highlight the row and column of current cell. That will make it easier to check for data or enter data.

reading layout

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!



The following VBA code can help you to highlight a row of selected cell dynamically, please do as follows:

1. Active the worksheet that you want to highlight the whole row of the selected cell, and then right click the sheet tab, and choose View Code from the right-click menu, see screenshot:

doc highlight whole row 1

2. In the opened Microsoft Visual Basic for Applications window, please copy the following code to this blank module:

VBA code: Highlight whole row when scrolling

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Update 20150603
Cells.Interior.ColorIndex = 0
Target.EntireRow.Interior.ColorIndex = 8
End Sub

3. Then save and close this code, now, when you click a cell, the whole row of this selected cell will be highlighted as following screenshots shown:

doc highlight whole row 2
 1
doc highlight whole row 3

Notes:

1. You can change the highlight color to another you like in this script “Target.EntireRow.Interior.ColorIndex = 8” , change the number 8 to another color index.

2. If you want to disable this code, you just need to go to the Microsoft Visual Basic for Applications window, and delete the code.

3. This code also can highlight the rows of selected range of cells as following result:

doc highlight whole row 4

4. This code is only applied to the current worksheet.

5. If there are some colored cells in your worksheet, the cell color will be lost when you apply this code.


If you would like to try to a new tool -- Kutools for Excel, with its Reading Layout, you can easily highlight the whole row or whole column or both row and column of active cell.

Auto highlight selected row / column / column and row in Excel

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days. 

After installing Kutools for Excel, please do with following steps:

1. Select a cell or a range of cells where you want to highlight the rows.

2. Click Kutools > Reading Layout drop down button > Reading Layout Settings, see screenshot:

doc highlight whole row 5

3. In the Reading Layout Settings dialog box, choose Straight line under the Shapes section, and then specify a style of this shape, at the same time, you can choose other options, such as color or transparency as you need, see screenshot:

doc highlight whole row 6

Tips: If you want to highlight the row and column of selected cell, please choose Criss-cross under the Shapes section, and choose Vertical line to highlight the whole column of active cell.

4. After finishing the settings in the dialog box, please click Ok, and now, when you click a cell, the whole row will be highlighted at once. And it will be dynamically moved as the selected cells change.

Notes:

1. You can cancel this utility by unchecking the Reading Layout again.

2. This Reading Layout feature is applied to all of the worksheets within your workbook.

3. This Reading Layout feature will be disabled when you launch the workbook next time.

4. With this utility, your colored cell will be preserved.

Click to know more details about this Reading Layout.

Download and free trial Kutools for Excel Now !


Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    David · 5 months ago
    is there a way to get it to only do a set of 4 cells along the specific row?
    • To post as a guest, your comment is unpublished.
      skyyang · 4 months ago
      Hello, David,
      The following VBA code can help you to highlight the cells that you selected, please try it. Hope it can help you!

      Private Sub Worksheet_SelectionChange(ByVal Target As Range)
      Cells.Interior.ColorIndex = 0
      Target.Interior.ColorIndex = 8
      End Sub
  • To post as a guest, your comment is unpublished.
    srinivas · 9 months ago
    Hi thanks for providing the code....it is so useful for our report, but actually for my report the hyperlink is there in the other sheet in the same workbook and highlighted cell is there in the next sheet, that selected cell row total should be selected. but while running this code im getting a run-time error '1004'. will you please help me on this ...
  • To post as a guest, your comment is unpublished.
    Sumanth · 1 years ago
    Thank You for this !
  • To post as a guest, your comment is unpublished.
    Lynn · 2 years ago
    Thank you for the code to highlight the whole row. It is *AWESOME* and is going to make scrolling spreadsheets so much easier.