Solved

HIghlight Rows in Excel based on Cursor location

Posted on 2011-10-14
6
7,666 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

751 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