Solved

HIghlight Rows in Excel based on Cursor location

Posted on 2011-10-14
6
7,369 Views
Last Modified: 2012-05-12
Is there a way to highlight the row the cursor is on in Excel so that it makes it easier to know which row you are on?  
0
Comment
Question by:ITworks
6 Comments
 

Assisted Solution

by:mnasr333
mnasr333 earned 125 total points
ID: 36971635
0
 
LVL 10

Accepted Solution

by:
broro183 earned 250 total points
ID: 36972987
Hi,

Here are a two more possibilities:

Chip Pearson's addin looks good: http://www.cpearson.com/excel/RowLiner.htm 

John McGimpsey has alternative code (copy & paste into your project in the VBE) http://www.mcgimpsey.com/excel/highlightrow.html 

However I think that both of these will disable your ability to "Undo" in excel.

Rob
0
 
LVL 18

Assisted Solution

by:krishnakrkc
krishnakrkc earned 125 total points
ID: 36973051
Hi,

Another one.

Kris


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    '// Developed by Kris @ ExcelFox.com
    
    Dim x, nmRow    As Name
    
    'if A1 holds '0', the macro won't fire
    If Me.Range("A1") = 0 Then Exit Sub 'adjust the flag cell
        
    On Error Resume Next
    Set nmRow = ThisWorkbook.Names("tRow")
    On Error GoTo 0
    
    Const HighlightColor As Long = 6750207

    If nmRow Is Nothing Then
        Set nmRow = ThisWorkbook.Names.Add("tRow", Target.Row & "|" & Target.EntireRow.Interior.Color, 0)
        Target.EntireRow.Interior.Color = HighlightColor
    Else
        x = Split(Evaluate("tRow"), "|")
        Me.Rows(CLng(x(0))).Interior.Color = IIf(CLng(x(1)) = 16777215, -4142, CLng(x(1)))
        nmRow.RefersTo = Target.Row & "|" & Target.EntireRow.Interior.Color
        Target.EntireRow.Interior.Color = HighlightColor
    End If

End Sub

Open in new window

0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 4

Author Closing Comment

by:ITworks
ID: 36974204
Thanks for all your help.  I am using the Chip Pearson's addin.....this was SUPER EASY to setup.
0
 
LVL 10

Expert Comment

by:broro183
ID: 36974363
Great, I'm pleased we could help :-)

Rob
0
 

Expert Comment

by:dewright22
ID: 37420212
Chris Pearson's add-on is perfect - just what I wanted and more. Thanks Chris.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question