How do I auto highlight the row and column I'm working on?

C

Cindy P

My spreadsheet is so large that it would be easier for me if the program
automatically highlighted the column and row I am working on. Does anyone
know if that's possible?
 
B

Bob Umlas

As long as you're not using any other color scheme, right-click the sheet
tab, select View Code, enter this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = 0
Target.EntireColumn.Interior.ColorIndex = 6
Target.EntireRow.Interior.ColorIndex = 6
End Sub
 
K

KC

Thanks for this question, was helpful for me as well to think through the
solution.

Insert 2 lines (place is anywhere on your sheet)
from Insert > Pictures > Auto Shapes
double click on the line and set the line color to BLUE and increase the
weight to 2.25 or any thickness you think is prominent.

then right-click the sheet tab > View Code > enter the below code:

'Beginning of code
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.Shapes("Line 1").Left = ActiveCell.Left
ActiveSheet.Shapes("Line 1").Top = ActiveCell.Top - 10
ActiveSheet.Shapes("Line 1").Height = ActiveCell.Height + 20
ActiveSheet.Shapes("Line 1").Width = 0

ActiveSheet.Shapes("Line 2").Left = ActiveCell.Left - 10
ActiveSheet.Shapes("Line 2").Top = ActiveCell.Top
ActiveSheet.Shapes("Line 2").Height = 0
ActiveSheet.Shapes("Line 2").Width = ActiveCell.Width + 20
End Sub

'End of Code


the above code would work assuming that the 2 lines you added was the only
first two lines in your workbook, else we need to find the right line name
and add it.

-kc
*Click YES if this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top