+ Reply to Thread
Results 1 to 11 of 11

highlight activecell

  1. #1
    flow23
    Guest

    highlight activecell

    I have huge database, which other colleagues view regularly.

    and I wondered if there is a way to highlight the activerow to make it easy
    to read?



  2. #2
    Bob Phillips
    Guest

    Re: highlight activecell

    Option Explicit

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

    .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

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "flow23" <[email protected]> wrote in message
    news:[email protected]...
    > I have huge database, which other colleagues view regularly.
    >
    > and I wondered if there is a way to highlight the activerow to make it

    easy
    > to read?
    >
    >




  3. #3
    flow23
    Guest

    Re: highlight activecell

    for some reason.. nothing is happening??
    I have Excel 2000. would that make any difference?


    "Bob Phillips" wrote:

    > Option Explicit
    >
    > '----------------------------------------------------------------
    > 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
    >
    > .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
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "flow23" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have huge database, which other colleagues view regularly.
    > >
    > > and I wondered if there is a way to highlight the activerow to make it

    > easy
    > > to read?
    > >
    > >

    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: highlight activecell

    No, it shouldn't. Did you put it in the sheet code module as instructed?

    Go to the immediate window and type

    Application.EnableEvents = True

    and try again.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "flow23" <[email protected]> wrote in message
    news:[email protected]...
    > for some reason.. nothing is happening??
    > I have Excel 2000. would that make any difference?
    >
    >
    > "Bob Phillips" wrote:
    >
    > > Option Explicit
    > >
    > > '----------------------------------------------------------------
    > > 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
    > >
    > > .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
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from email address if mailing direct)
    > >
    > > "flow23" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I have huge database, which other colleagues view regularly.
    > > >
    > > > and I wondered if there is a way to highlight the activerow to make it

    > > easy
    > > > to read?
    > > >
    > > >

    > >
    > >
    > >




  5. #5
    flow23
    Guest

    RE: highlight activecell

    thanks
    I found out.. I put it in workbook.. not worksheet
    many thanks


    "flow23" wrote:

    > I have huge database, which other colleagues view regularly.
    >
    > and I wondered if there is a way to highlight the activerow to make it easy
    > to read?
    >
    >


  6. #6
    Peter Rooney
    Guest

    Re: highlight activecell

    Bob,

    I attempted a version of this that would highlight both active row AND
    column, but I get the message "Application defined or Object defined error"
    at the line marked with an asterisk.
    Any idea why?
    Thanks in advance
    Pete

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Cells.FormatConditions.Delete
    With Target.EntireRow
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    With .FormatConditions(1)
    With .Borders(xlTop)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 10
    End With
    With .Borders(xlBottom)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 10
    End With
    End With
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 20
    End With
    '-------------------------------------------------------------------------
    With Target.EntireColumn
    * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    With .FormatConditions(1)
    With .Borders(xlLeft)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 10
    End With
    With .Borders(xlRight)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 10
    End With
    End With
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 20
    End With

    End Sub


    "Bob Phillips" wrote:

    > Option Explicit
    >
    > '----------------------------------------------------------------
    > 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
    >
    > .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
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "flow23" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have huge database, which other colleagues view regularly.
    > >
    > > and I wondered if there is a way to highlight the activerow to make it

    > easy
    > > to read?
    > >
    > >

    >
    >
    >


  7. #7
    Bob Phillips
    Guest

    Re: highlight activecell

    Hi Peter,

    Before adding conditions to the column, you have to delete any existing
    conditions (the intersect will have one), then it works. It also looks
    better IMO to highlight the activecell differently when you do both row and
    column

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Cells.FormatConditions.Delete
    With Target.EntireRow
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    With .FormatConditions(1)
    With .Borders(xlTop)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 10
    End With
    With .Borders(xlBottom)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 10
    End With
    End With
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 20
    End With

    '-------------------------------------------------------------------------
    With Target.EntireColumn
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    With .FormatConditions(1)
    With .Borders(xlLeft)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 10
    End With
    With .Borders(xlRight)
    .LineStyle = xlContinuous
    .Weight = xlThin
    .ColorIndex = 10
    End With
    End With
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 20
    End With

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

    End Sub

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Peter Rooney" <[email protected]> wrote in message
    news:[email protected]...
    > Bob,
    >
    > I attempted a version of this that would highlight both active row AND
    > column, but I get the message "Application defined or Object defined

    error"
    > at the line marked with an asterisk.
    > Any idea why?
    > Thanks in advance
    > Pete
    >
    > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > Cells.FormatConditions.Delete
    > With Target.EntireRow
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > With .FormatConditions(1)
    > With .Borders(xlTop)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = 10
    > End With
    > With .Borders(xlBottom)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = 10
    > End With
    > End With
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 20
    > End With
    >

    '-------------------------------------------------------------------------
    > With Target.EntireColumn
    > * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > With .FormatConditions(1)
    > With .Borders(xlLeft)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = 10
    > End With
    > With .Borders(xlRight)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = 10
    > End With
    > End With
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 20
    > End With
    >
    > End Sub
    >
    >
    > "Bob Phillips" wrote:
    >
    > > Option Explicit
    > >
    > > '----------------------------------------------------------------
    > > 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
    > >
    > > .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
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from email address if mailing direct)
    > >
    > > "flow23" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I have huge database, which other colleagues view regularly.
    > > >
    > > > and I wondered if there is a way to highlight the activerow to make it

    > > easy
    > > > to read?
    > > >
    > > >

    > >
    > >
    > >




  8. #8
    CLR
    Guest

    Re: highlight activecell

    I tried Bob's code straight away and it worked super fine......

    Here's a little variation to highlight the cell in a different way.....

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Cells.ClearComments
    With Target
    .AddComment.Visible = True
    .Comment.Text ("Edit Me")
    End With
    End Sub

    Vaya con Dios,
    Chuck, CABGx3



    "flow23" <[email protected]> wrote in message
    news:[email protected]...
    > I have huge database, which other colleagues view regularly.
    >
    > and I wondered if there is a way to highlight the activerow to make it

    easy
    > to read?
    >
    >




  9. #9
    Bob Phillips
    Guest

    Re: highlight activecell

    Reply, that's a good idea for another post I answered, where the guy wanted
    formula cells highlighted.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "CLR" <[email protected]> wrote in message
    news:[email protected]...
    > I tried Bob's code straight away and it worked super fine......
    >
    > Here's a little variation to highlight the cell in a different way.....
    >
    > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > Cells.ClearComments
    > With Target
    > .AddComment.Visible = True
    > .Comment.Text ("Edit Me")
    > End With
    > End Sub
    >
    > Vaya con Dios,
    > Chuck, CABGx3
    >
    >
    >
    > "flow23" <[email protected]> wrote in message
    > news:[email protected]...
    > > I have huge database, which other colleagues view regularly.
    > >
    > > and I wondered if there is a way to highlight the activerow to make it

    > easy
    > > to read?
    > >
    > >

    >
    >




  10. #10
    Peter Rooney
    Guest

    Re: highlight activecell

    Bob,

    That works fine - thanks for responding to me interrupting someone else's
    thread!

    Pete




    "Bob Phillips" wrote:

    > Hi Peter,
    >
    > Before adding conditions to the column, you have to delete any existing
    > conditions (the intersect will have one), then it works. It also looks
    > better IMO to highlight the activecell differently when you do both row and
    > column
    >
    > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > Cells.FormatConditions.Delete
    > With Target.EntireRow
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > With .FormatConditions(1)
    > With .Borders(xlTop)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = 10
    > End With
    > With .Borders(xlBottom)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = 10
    > End With
    > End With
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 20
    > End With
    >
    > '-------------------------------------------------------------------------
    > With Target.EntireColumn
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > With .FormatConditions(1)
    > With .Borders(xlLeft)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = 10
    > End With
    > With .Borders(xlRight)
    > .LineStyle = xlContinuous
    > .Weight = xlThin
    > .ColorIndex = 10
    > End With
    > End With
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 20
    > End With
    >
    > With Target
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 36
    > End With
    >
    > End Sub
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Peter Rooney" <[email protected]> wrote in message
    > news:[email protected]...
    > > Bob,
    > >
    > > I attempted a version of this that would highlight both active row AND
    > > column, but I get the message "Application defined or Object defined

    > error"
    > > at the line marked with an asterisk.
    > > Any idea why?
    > > Thanks in advance
    > > Pete
    > >
    > > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > > Cells.FormatConditions.Delete
    > > With Target.EntireRow
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > With .FormatConditions(1)
    > > With .Borders(xlTop)
    > > .LineStyle = xlContinuous
    > > .Weight = xlThin
    > > .ColorIndex = 10
    > > End With
    > > With .Borders(xlBottom)
    > > .LineStyle = xlContinuous
    > > .Weight = xlThin
    > > .ColorIndex = 10
    > > End With
    > > End With
    > > .FormatConditions.Delete
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > .FormatConditions(1).Interior.ColorIndex = 20
    > > End With
    > >

    > '-------------------------------------------------------------------------
    > > With Target.EntireColumn
    > > * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > With .FormatConditions(1)
    > > With .Borders(xlLeft)
    > > .LineStyle = xlContinuous
    > > .Weight = xlThin
    > > .ColorIndex = 10
    > > End With
    > > With .Borders(xlRight)
    > > .LineStyle = xlContinuous
    > > .Weight = xlThin
    > > .ColorIndex = 10
    > > End With
    > > End With
    > > .FormatConditions.Delete
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > .FormatConditions(1).Interior.ColorIndex = 20
    > > End With
    > >
    > > End Sub
    > >
    > >
    > > "Bob Phillips" wrote:
    > >
    > > > Option Explicit
    > > >
    > > > '----------------------------------------------------------------
    > > > 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
    > > >
    > > > .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
    > > >
    > > > Bob Phillips
    > > >
    > > > (remove nothere from email address if mailing direct)
    > > >
    > > > "flow23" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > I have huge database, which other colleagues view regularly.
    > > > >
    > > > > and I wondered if there is a way to highlight the activerow to make it
    > > > easy
    > > > > to read?
    > > > >
    > > > >
    > > >
    > > >
    > > >

    >
    >
    >


  11. #11
    Bob Phillips
    Guest

    Re: highlight activecell

    I don't think anyone minds <vbg>

    Bob


    "Peter Rooney" <[email protected]> wrote in message
    news:[email protected]...
    > Bob,
    >
    > That works fine - thanks for responding to me interrupting someone else's
    > thread!
    >
    > Pete
    >
    >
    >
    >
    > "Bob Phillips" wrote:
    >
    > > Hi Peter,
    > >
    > > Before adding conditions to the column, you have to delete any existing
    > > conditions (the intersect will have one), then it works. It also looks
    > > better IMO to highlight the activecell differently when you do both row

    and
    > > column
    > >
    > > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > > Cells.FormatConditions.Delete
    > > With Target.EntireRow
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > With .FormatConditions(1)
    > > With .Borders(xlTop)
    > > .LineStyle = xlContinuous
    > > .Weight = xlThin
    > > .ColorIndex = 10
    > > End With
    > > With .Borders(xlBottom)
    > > .LineStyle = xlContinuous
    > > .Weight = xlThin
    > > .ColorIndex = 10
    > > End With
    > > End With
    > > .FormatConditions.Delete
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > .FormatConditions(1).Interior.ColorIndex = 20
    > > End With
    > >
    > >

    '-------------------------------------------------------------------------
    > > With Target.EntireColumn
    > > .FormatConditions.Delete
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > With .FormatConditions(1)
    > > With .Borders(xlLeft)
    > > .LineStyle = xlContinuous
    > > .Weight = xlThin
    > > .ColorIndex = 10
    > > End With
    > > With .Borders(xlRight)
    > > .LineStyle = xlContinuous
    > > .Weight = xlThin
    > > .ColorIndex = 10
    > > End With
    > > End With
    > > .FormatConditions.Delete
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > .FormatConditions(1).Interior.ColorIndex = 20
    > > End With
    > >
    > > With Target
    > > .FormatConditions.Delete
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > .FormatConditions(1).Interior.ColorIndex = 36
    > > End With
    > >
    > > End Sub
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (remove nothere from email address if mailing direct)
    > >
    > > "Peter Rooney" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Bob,
    > > >
    > > > I attempted a version of this that would highlight both active row AND
    > > > column, but I get the message "Application defined or Object defined

    > > error"
    > > > at the line marked with an asterisk.
    > > > Any idea why?
    > > > Thanks in advance
    > > > Pete
    > > >
    > > > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    > > > Cells.FormatConditions.Delete
    > > > With Target.EntireRow
    > > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > > With .FormatConditions(1)
    > > > With .Borders(xlTop)
    > > > .LineStyle = xlContinuous
    > > > .Weight = xlThin
    > > > .ColorIndex = 10
    > > > End With
    > > > With .Borders(xlBottom)
    > > > .LineStyle = xlContinuous
    > > > .Weight = xlThin
    > > > .ColorIndex = 10
    > > > End With
    > > > End With
    > > > .FormatConditions.Delete
    > > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > > .FormatConditions(1).Interior.ColorIndex = 20
    > > > End With
    > > >

    > >

    '-------------------------------------------------------------------------
    > > > With Target.EntireColumn
    > > > * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > > With .FormatConditions(1)
    > > > With .Borders(xlLeft)
    > > > .LineStyle = xlContinuous
    > > > .Weight = xlThin
    > > > .ColorIndex = 10
    > > > End With
    > > > With .Borders(xlRight)
    > > > .LineStyle = xlContinuous
    > > > .Weight = xlThin
    > > > .ColorIndex = 10
    > > > End With
    > > > End With
    > > > .FormatConditions.Delete
    > > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > > .FormatConditions(1).Interior.ColorIndex = 20
    > > > End With
    > > >
    > > > End Sub
    > > >
    > > >
    > > > "Bob Phillips" wrote:
    > > >
    > > > > Option Explicit
    > > > >
    > > > > '----------------------------------------------------------------
    > > > > 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
    > > > >
    > > > > .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
    > > > >
    > > > > Bob Phillips
    > > > >
    > > > > (remove nothere from email address if mailing direct)
    > > > >
    > > > > "flow23" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > I have huge database, which other colleagues view regularly.
    > > > > >
    > > > > > and I wondered if there is a way to highlight the activerow to

    make it
    > > > > easy
    > > > > > to read?
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




+ 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