Link to home
Create AccountLog in
Avatar of ArisaAnsar
ArisaAnsarFlag for United States of America

asked on

Need Help with Excel (Row Highlighting)

Hi,
I have an Excel file with over 9000+ rows.  Is there a way when I click in a specific row to update, the entire row is temporary highlighted in another color to let me quickly see all cells that need updating?

The spreadsheet have over 40 columns so highlighting the row, will make it easier to ensure I am updating the correct cells.
Avatar of byundt
byundt
Flag of United States of America image

One approach is to use a Worksheet_SelectionChange event sub to select the entire column and entire row when you click on a cell. Those cells will be highlighted in gray so you may easily tell where you are. The code to do this must be put in the code pane for the worksheet being watched, and the file must be saved with either .xlsm or .xlsb file extension.
'This code must go in the code pane of the worksheet being watched
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Union(Target.EntireRow, Target.EntireColumn).Select
Target.Activate
Application.EnableEvents = True
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of ArisaAnsar

ASKER

Ryan - this is very helpful as it allowed me to highlight the row and still continue to use the "Control F" feature.

byundt - for some reason, I couldn't use the "Control F" to search the spreadsheet for specific accounts but I loved how it highlighted both the row and column.
@Roy

Useful stuffs too, thanks for sharing = )
I've used the first one for years.

The only issue with using Styles is that sometimes if a row contains different Styles then they can be over-written.