Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Mar 2002
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional Formatting (97 sr2)

    Is it possible, and if so how, to program a cell with conditional formatting via VBA ?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Formatting (97 sr2)

    This is what you get when you record a macro (!) when setting up a conditional format:

    Option Explicit

    Sub Macro1()
    '
    ' Macro1 Macro
    ' Macro recorded 11-04-2002 by Jan Karel @ Newtoms
    '

    '
    Selection.FormatConditions.Delete
    Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
    , Formula1:="25"
    Selection.FormatConditions(1).Interior.ColorIndex = 3
    End Sub
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Lounger
    Join Date
    Mar 2002
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Formatting (97 sr2)

    DOH! Record Macro ... Why didn't *I* think of that!?!
    <img src=/S/doh.gif border=0 alt=doh width=15 height=15>

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional Formatting (97 sr2)

    Oh well, Forest, trees <vbg>.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •