Results 1 to 5 of 5

Thread: How to highlight an active line ?

  1. #1
    Join Date
    Feb 2009
    Posts
    63

    How to highlight an active line ?

    hi,

    In Microsoft Excel, I would like the current line or active line to be highlighted. Also, suggest me if I highlight an active line with a specific color, then how can I modify it with a different color ? Can anybody help me providing the useful and related information about the same ?

    thank you...

  2. #2
    Join Date
    May 2008
    Posts
    3,316

    Re: How to highlight an active line ?

    Highlight the Column of the Selected Cell using MACRO

    Consider the following Macro Code

    Code:
    Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) 
    
    Static cc
    
    If cc <> "" Then
    With Columns(cc).Interior
    .ColorIndex = xlNone
    End With
    End If
    
    c = Selection.Column
    cc = c
    
    With Columns(c).Interior
    .ColorIndex = 6
    .Pattern = xlSolid
    End With
    
    End Sub

  3. #3
    Join Date
    May 2008
    Posts
    3,316

    Re: How to highlight an active line ?

    • This macro will highlight the row and column of the active cell.
    • This will fill the column of the active cell with a solid background color and remove the color when a different cell is selected within the excel spreadsheet.
    • Anytime you select a different cell, the new column and row will be highlighted.
    • This is a great macro for zeroing in on a specific cell during a presentation or just when working in a really big spreadsheet.
    • Also, if you remove the gridlines from the spreadsheet, it can be hard to determine which row or column a cell is in and this will allow you to figure that out much quicker.
    • This macro will overwrite any previous color in the selected cell and column. That means that if you have a worksheet with a lot of background colors and you use this macro and start selecting cells, the previous background colors will disappear.


    To change the color of the highlight change the number in this line of code .ColorIndex = 6.

  4. #4
    Join Date
    May 2008
    Posts
    4,831

    Re: How to highlight an active line ?

    I had a small macro that kept the selected cell's row highlighted in yellow. I wanted to modify it according to my preferences -

    Here's the code:

    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    Cells.Interior.ColorIndex = xlColorIndexNone
    If Application.WorksheetFunction. CountA(Range(Target.Address).EntireRow.Offset(-1, 0)) <> 0 Then
    Target.EntireRow.Interior.ColorIndex = 6
    End If
    End Sub

  5. #5
    Join Date
    Jul 2009
    Posts
    1

    Re: How to highlight an active line ?

    Two options from youtube:

    1) http://www.youtube.com/watch?v=bGjqDGF7xaM gives instructions on how to do this very neatly with conditional formatting and vba (from www.msofficegurus.com)
    2) http://www.youtube.com/watch?v=hXhI-NaEaqM shows an addin you can install (from www.cloudninepointzero.com)

Similar Threads

  1. Highlight a line of a TextEdit
    By Bettina in forum Software Development
    Replies: 3
    Last Post: 28-11-2009, 09:35 AM
  2. How to let Java read text file line by line.
    By Visala28 in forum Software Development
    Replies: 3
    Last Post: 04-08-2009, 11:30 PM
  3. How to Highlight TreeView.SelectedNode in VB.Net
    By Pratyush in forum Software Development
    Replies: 3
    Last Post: 03-03-2009, 03:10 PM
  4. How to configure Active-Active and Active-Passive Cluster ?
    By Praveen P in forum Windows Server Help
    Replies: 5
    Last Post: 16-12-2008, 01:28 AM
  5. DSRM.exe Active Directory command line tool
    By Joe in forum Windows Server Help
    Replies: 2
    Last Post: 10-03-2006, 07:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,218,179.08616 seconds with 17 queries