We’d like to remind Forumites to please avoid political debate on the Forum.
This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Microsoft Excel Help Required ... please !
WLM21
Posts: 1,623 Forumite
in Techie Stuff
Is there any way to highlight the row (or indeed the column) of a cell in use.
All I get at the moment is a very small blue highlight over the row number (and column letter) This is not very clear, especially when completing several columns, many quite a distance from the row name.
Yes, I could use the freeze or window commands, but if the whole row could be highlighted, it would be much easier.
Is this possible please ?
All I get at the moment is a very small blue highlight over the row number (and column letter) This is not very clear, especially when completing several columns, many quite a distance from the row name.
Yes, I could use the freeze or window commands, but if the whole row could be highlighted, it would be much easier.
Is this possible please ?
0
Comments
-
-
I don't know of an easy automatic way to do what you want but if you click on the row or column rather than the cell it highlights the whole row or column. This is no good if you are trying to enter data. Whichever cell you are "in" is shown to the left of the formula bar. If you are into vba (visual basic) there are programs that you can use, see the following link: -
https://msdn.microsoft.com/en-us/library/office/ff820716.aspx?f=255&MSPPError=-21472173960 -
Thanks for the advice.
I have an old version of Excel and it isn't working.
On the 2nd link provided, it says from 2013 onwards0 -
You can right-click on the tab, select View Code, select ThisWorkbook in the Objects folder at the side, and paste the following code:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Rows(Target.Row & ":" & Target.Row).Select
End Sub
However, all it does is highlight the row. It doesn't allow you to type anything into one of the cells.
If a cell is selected, by definition, the row isn't selected as well.0 -
Actually, scratch that, the following code should give you a decent result:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
With Cells.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Range("A" & Target.Row & ":Z" & Target.Row).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
End With
With Target.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
On the With Range("A" & Target.Row & ":Z" & Target.Row).Interior line, change Z for whatever your last column is, or change it to something silly like ZZ to create the illusion that the entire row is highlighted.
The ThemeColor and TintAndShade make the row a grey highlighted colour. If you need it to be a different colour, let me know.
Highlighting the column instead of the row might be slightly trickier.0 -
damianjmcgrath wrote: »You can right-click on the tab, select View Code, select ThisWorkbook in the Objects folder at the side, and paste the following code:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Rows(Target.Row & ":" & Target.Row).Select
End Sub
However, all it does is highlight the row. It doesn't allow you to type anything into one of the cells.
If a cell is selected, by definition, the row isn't selected as well.
Tried this first
Highlights row well, but I can only enter data in column A0 -
damianjmcgrath wrote: »Actually, scratch that, the following code should give you a decent result:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
With Cells.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Range("A" & Target.Row & ":Z" & Target.Row).Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
End With
With Target.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
End Sub
On the With Range("A" & Target.Row & ":Z" & Target.Row).Interior line, change Z for whatever your last column is, or change it to something silly like ZZ to create the illusion that the entire row is highlighted.
The ThemeColor and TintAndShade make the row a grey highlighted colour. If you need it to be a different colour, let me know.
Highlighting the column instead of the row might be slightly trickier.
Tried this too .. pretty good
If I click on the row number the whole row is highlighted. I can then move along it and click on a cell to enter data. The highlight is then lost though.0 -
How do you mean? Purposely, the code highlights all of the cells (between A-Z) in the row, except for the cell you clicked on, which has No Fill, so that it's easier to see which one you're on.
If you didn't want that, and you wanted the cell you click on to keep the highlight, just remove these lines from the bottom of that code:
With Target.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With0 -
Is everything working as you wanted now?0
-
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 352.4K Banking & Borrowing
- 253.7K Reduce Debt & Boost Income
- 454.4K Spending & Discounts
- 245.4K Work, Benefits & Business
- 601.2K Mortgages, Homes & Bills
- 177.6K Life & Family
- 259.3K Travel & Transport
- 1.5M Hobbies & Leisure
- 16K Discuss & Feedback
- 37.7K Read-Only Boards
