+ Reply to Thread
Results 1 to 3 of 3

Limit Row and Column Highlight

  1. #1
    Bill
    Guest

    Limit Row and Column Highlight

    How can I adjust the following code that is used to create highlight cross
    hairs so that only the column cells from rows 3 to row 10 and that the row is
    ony hightlight from column A to I.


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

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


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


    Thanks

    Bill

  2. #2
    Bob Phillips
    Guest

    Re: Limit Row and Column Highlight

    Bill,

    Is this what you want

    Cells.FormatConditions.Delete
    If Not Intersect(Target, Range("A3:J10")) Is Nothing Then
    With Range("A" & Target.Row).Resize(1, 10)
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 37
    End With

    With Cells(3, Target.Column).Resize(8)
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 37
    End With


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


    --

    HTH

    Bob Phillips

    (remove nothere from the email address if mailing direct)

    "Bill" <[email protected]> wrote in message
    news:[email protected]...
    > How can I adjust the following code that is used to create highlight cross
    > hairs so that only the column cells from rows 3 to row 10 and that the row

    is
    > ony hightlight from column A to I.
    >
    >
    > With Target.EntireRow
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 37
    > End With
    >
    > With Target.EntireColumn
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 37
    > End With
    >
    >
    > With Target
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 36
    > End With
    >
    >
    > Thanks
    >
    > Bill




  3. #3
    Tom Ogilvy
    Guest

    Re: Limit Row and Column Highlight

    With cells(Target.Row,"A").Resize(1,9)
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 37
    End With

    With cells(3,Target.Column).Resize(8,1)
    .FormatConditions.Delete
    .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = 37
    End With


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

    --
    Regards,
    Tom Ogilvy


    "Bill" <[email protected]> wrote in message
    news:[email protected]...
    > How can I adjust the following code that is used to create highlight cross
    > hairs so that only the column cells from rows 3 to row 10 and that the row

    is
    > ony hightlight from column A to I.
    >
    >
    > With Target.EntireRow
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 37
    > End With
    >
    > With Target.EntireColumn
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 37
    > End With
    >
    >
    > With Target
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 36
    > End With
    >
    >
    > Thanks
    >
    > Bill




+ 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