Highlight CURRENT row

Roni

Board Regular
Joined
Apr 2, 2002
Messages
231
I have a tremendously long spreadsheet and have to enter information in many columns pertaining to the information in the first two columns. Sometimes I can not tell if I'm on the correct row... so what I'd like to be able to to is...

Whatever row my cursor is currently in, I would like that entire row to highlight itself. (Perferably in a yellow highlight format). Is this something I can do in Excel?
 
Roni,
Have you tried Windows, New Window, New Window, Arrange, Horizantal. Neat for comparing or whatever.
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
hi,
Following code is working fine, but problem is that when I copy a cell and paste another location it does not allow. Plz help.


Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Cells.Interior.ColorIndex = xlNone
With Target.EntireRow.Interior
.ColorIndex = 37
.Pattern = xlGray25
.PatternColorIndex = 24
End With
End Sub
 
Upvote 0
This is normal when using the "Workbook_SheetSelectionChange" Event, however you can use "Drag & Drop" whitin the sheet or you can set EnableEvents= False and enable it again when needed.

I use a macrobutton for this.

Sub Copy_Paste()
Dim xText As Variant

If Application.EnableEvents = True Then
Application.EnableEvents = False

Cells.FormatConditions.Delete
Application.CommandBars("JFP_FLS").Controls("Event On").Caption = "Event Off"

Else
If Application.EnableEvents = False Then
Application.EnableEvents = True
Application.CommandBars("JFP_FLS").Controls("Event Off").Caption = "Event On"

End If
End If
End Sub

Regards John
 
Upvote 0
Hi,
This highlight code is one of the best i've found. It will not only highlight your row but, your column as well. Also, it will not remove any previous colors you've placed on your sheet.

*Right click on sheet tab, view code, paste their;

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim iColor As Integer
'/// Ivan F Moala's code modified by Nate by request
'// Amended routine found on this Web site
'// Note: Don't use IF you have Conditional
'// formating that you want to keep!

'// On error resume in case
'// user selects a range of cells
On Error Resume Next
iColor = Target.Interior.ColorIndex
'Leave On Error ON for Row offset errors

If iColor < 0 Then
iColor = 37
Else:
iColor = iColor + 1
End If

'// Need this test incase Font color is the same
If iColor = Target.Font.ColorIndex Then iColor = iColor + 1

Cells.FormatConditions.Delete

'// Horizontal color banding
With Rows(Target.Row)
.FormatConditions.Add Type:=2, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = iColor
End With

'// Vertical color banding
With Range(Target.Offset(1 - Target.Row, 0).Address & ":" _
& Target.Offset(-1, 0).Address) 'Rows(Target.Row)
.FormatConditions.Add Type:=2, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = iColor
End With

End Sub



Good luck,
Noir
 
Upvote 0

Forum statistics

Threads
1,214,382
Messages
6,119,194
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top