+ Reply to Thread
Results 1 to 3 of 3

Row & column automatic highlight

  1. #1
    gcaramaliu
    Guest

    Row & column automatic highlight

    Is it possible to automaticly highlight the entire row and column when I
    select an certain cell?

  2. #2
    Dave Peterson
    Guest

    Re: Row & column automatic highlight

    you may want to try Chip Pearson's Rowliner:
    http://www.cpearson.com/excel/RowLiner.htm

    gcaramaliu wrote:
    >
    > Is it possible to automaticly highlight the entire row and column when I
    > select an certain cell?


    --

    Dave Peterson

  3. #3
    Bob Phillips
    Guest

    Re: Row & column automatic highlight

    Here's another way

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.



    '----------------------------------------------------------------
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    '----------------------------------------------------------------
    Cells.FormatConditions.Delete
    With Target
    .EntireRow.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    AddRowBorders Target.EntireRow
    With .EntireColumn
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    End With
    AddColumnBorders Target.EntireColumn

    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 36
    End With

    End Sub

    Private Sub AddRowBorders(pRow As Range)
    With pRow
    With .FormatConditions(1)
    With .Borders(xlTop)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 5
    End With
    With .Borders(xlBottom)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 5
    End With
    .Interior.ColorIndex = 20
    End With
    End With
    End Sub

    Private Sub AddColumnBorders(pColumn As Range)
    With pColumn
    With .FormatConditions(1)
    With .Borders(xlLeft)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 5
    End With
    With .Borders(xlRight)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 5
    End With
    .Interior.ColorIndex = 20
    End With
    End With
    End Sub


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "gcaramaliu" <gcaramaliu@discussions.microsoft.com> wrote in message
    news:336DB70A-3E11-4C8D-97F3-554966C7561B@microsoft.com...
    > Is it possible to automaticly highlight the entire row and column when I
    > select an certain cell?




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1