+ Reply to Thread
Results 1 to 4 of 4

Conditional Format w/ row highlight code

  1. #1
    Adria D.
    Guest

    Conditional Format w/ row highlight code

    Happy Friday, all.

    I am using this code to highlight the active row in Excel 2000. The
    problem is that I cannot use this and keep my conditional formatting
    that I have changing the Font on one of the columns.

    Thanks in advance for your help, code to follow.

    -Adria D.

    ******************************************************

    ActiveSheet.Unprotect Password:="mypass"


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

    With ActiveSheet
    .EnableAutoFilter = True
    .Protect Password:="mypass", _
    DrawingObjects:=False, UserInterfaceOnly:=True
    End With

    Application.EnableEvents = True

    End Sub


  2. #2
    Dave Peterson
    Guest

    Re: Conditional Format w/ row highlight code

    Maybe you could just use Chip Pearson's rowliner addin:

    http://www.cpearson.com/excel/RowLiner.htm



    "Adria D." wrote:
    >
    > Happy Friday, all.
    >
    > I am using this code to highlight the active row in Excel 2000. The
    > problem is that I cannot use this and keep my conditional formatting
    > that I have changing the Font on one of the columns.
    >
    > Thanks in advance for your help, code to follow.
    >
    > -Adria D.
    >
    > ******************************************************
    >
    > ActiveSheet.Unprotect Password:="mypass"
    >
    > Cells.FormatConditions.Delete
    > With Target.EntireRow
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 36
    > End With
    > With Target
    > .FormatConditions.Delete
    > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > .FormatConditions(1).Interior.ColorIndex = 36
    > End With
    >
    > With ActiveSheet
    > .EnableAutoFilter = True
    > .Protect Password:="mypass", _
    > DrawingObjects:=False, UserInterfaceOnly:=True
    > End With
    >
    > Application.EnableEvents = True
    >
    > End Sub


    --

    Dave Peterson

  3. #3
    Adria D.
    Guest

    Re: Conditional Format w/ row highlight code

    Dave,

    I would prefer not to use the add-in, if at all possible, since there
    are many users that would need to load the add-in. Does anyone know how
    to preserve conditional formatting while using the row highlight on
    selection change?

    -AD



    Dave Peterson wrote:
    > Maybe you could just use Chip Pearson's rowliner addin:
    >
    > http://www.cpearson.com/excel/RowLiner.htm
    >
    >
    >
    > "Adria D." wrote:
    > >
    > > Happy Friday, all.
    > >
    > > I am using this code to highlight the active row in Excel 2000. The
    > > problem is that I cannot use this and keep my conditional formatting
    > > that I have changing the Font on one of the columns.
    > >
    > > Thanks in advance for your help, code to follow.
    > >
    > > -Adria D.
    > >
    > > ******************************************************
    > >
    > > ActiveSheet.Unprotect Password:="mypass"
    > >
    > > Cells.FormatConditions.Delete
    > > With Target.EntireRow
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > .FormatConditions(1).Interior.ColorIndex = 36
    > > End With
    > > With Target
    > > .FormatConditions.Delete
    > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > .FormatConditions(1).Interior.ColorIndex = 36
    > > End With
    > >
    > > With ActiveSheet
    > > .EnableAutoFilter = True
    > > .Protect Password:="mypass", _
    > > DrawingObjects:=False, UserInterfaceOnly:=True
    > > End With
    > >
    > > Application.EnableEvents = True
    > >
    > > End Sub

    >
    > --
    >
    > Dave Peterson



  4. #4
    Dave Peterson
    Guest

    Re: Conditional Format w/ row highlight code

    I would think you'd have to keep track of all the things involved in
    format|Conditional formatting.

    That means the rules/formulas, the formatting (all of it--font/font
    style/color/underline/strikethrough, each border (location, color, style), and
    pattern.

    Not a trivial task.

    Maybe you could set up another worksheet where you can paste the existing
    formats (just once manually), then with every selection change, copy the saved
    format back over the cell you just moved from. (or copy the whole sheet's
    format and paste, then apply the new conditional formatting.)

    Just an idea.

    "Adria D." wrote:
    >
    > Dave,
    >
    > I would prefer not to use the add-in, if at all possible, since there
    > are many users that would need to load the add-in. Does anyone know how
    > to preserve conditional formatting while using the row highlight on
    > selection change?
    >
    > -AD
    >
    > Dave Peterson wrote:
    > > Maybe you could just use Chip Pearson's rowliner addin:
    > >
    > > http://www.cpearson.com/excel/RowLiner.htm
    > >
    > >
    > >
    > > "Adria D." wrote:
    > > >
    > > > Happy Friday, all.
    > > >
    > > > I am using this code to highlight the active row in Excel 2000. The
    > > > problem is that I cannot use this and keep my conditional formatting
    > > > that I have changing the Font on one of the columns.
    > > >
    > > > Thanks in advance for your help, code to follow.
    > > >
    > > > -Adria D.
    > > >
    > > > ******************************************************
    > > >
    > > > ActiveSheet.Unprotect Password:="mypass"
    > > >
    > > > Cells.FormatConditions.Delete
    > > > With Target.EntireRow
    > > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > > .FormatConditions(1).Interior.ColorIndex = 36
    > > > End With
    > > > With Target
    > > > .FormatConditions.Delete
    > > > .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
    > > > .FormatConditions(1).Interior.ColorIndex = 36
    > > > End With
    > > >
    > > > With ActiveSheet
    > > > .EnableAutoFilter = True
    > > > .Protect Password:="mypass", _
    > > > DrawingObjects:=False, UserInterfaceOnly:=True
    > > > End With
    > > >
    > > > Application.EnableEvents = True
    > > >
    > > > End Sub

    > >
    > > --
    > >
    > > Dave Peterson


    --

    Dave Peterson

+ 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