Solved

HIghlight Rows in Excel based on Cursor location

Posted on 2011-10-14
6
8,087 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This video discusses moving either the default database or any database to a new volume.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the adminiā€¦

631 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