Solved

HIghlight Rows in Excel based on Cursor location

Posted on 2011-10-14
6
6,204 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Resolve DNS query failed errors for Exchange
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now