+ Reply to Thread
Results 1 to 3 of 3

Highlighting Rows

  1. #1
    mem
    Guest

    Highlighting Rows

    Hi

    Is there a way in which the row you are currently on in excel is highlighted
    in a different colour, and reverts back to original when user moves to a new
    row?

    Thanks



  2. #2
    Don Guillett
    Guest

    Re: Highlighting Rows

    right click sheet tab>view code>paste this>SAVE. You'll like it.

    'McCurdy.Here is something inspired by Don Guillett.
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim MyRng As Range
    Set MyRng = Target.EntireRow
    Application.EnableEvents = False
    On Error GoTo end1
    Application.Cells.FormatConditions.Delete
    With MyRng
    .FormatConditions.Add Type:=xlExpression, Formula1:= _
    "=ROW()=ROW(INDIRECT(CELL(""address"")))"
    With .FormatConditions(1).Font
    .Bold = True
    .Italic = False
    .ColorIndex = 1
    End With
    .FormatConditions(1).Interior.ColorIndex = 36
    End With
    end1:
    Application.EnableEvents = True
    End Sub

    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "mem" <mem.saab@ntlworld.com> wrote in message
    news:PvS7f.2983$sA4.718@newsfe2-win.ntli.net...
    > Hi
    >
    > Is there a way in which the row you are currently on in excel is

    highlighted
    > in a different colour, and reverts back to original when user moves to a

    new
    > row?
    >
    > Thanks
    >
    >




  3. #3
    Bob Phillips
    Guest

    Re: Highlighting Rows

    Similar to Don's, a bit more elaborate perhaps


    '----------------------------------------------------------------
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    '----------------------------------------------------------------
    Cells.FormatConditions.Delete
    With Target
    With .EntireRow
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    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
    With .EntireColumn
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    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

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

    End Sub


    '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.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mem" <mem.saab@ntlworld.com> wrote in message
    news:PvS7f.2983$sA4.718@newsfe2-win.ntli.net...
    > Hi
    >
    > Is there a way in which the row you are currently on in excel is

    highlighted
    > in a different colour, and reverts back to original when user moves to a

    new
    > row?
    >
    > Thanks
    >
    >




+ 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