Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Oct 2001
    Location
    Ellettsville, Indiana, USA
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional formatting (XL 2000)

    Is there a way to quickly view a conditional format that has been placed on a range other than going to format-conditional formatting... more like seeing it in the formula bar or within the cell?

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Conditional formatting (XL 2000)

    Not really, but how about adding it to your Right-click ToolBar, as explained <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=xl&Number=60759>here</A> by Menu Master Brooke?
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional formatting (XL 2000)

    I don't know if you want to see the conditions, the formats are both. You can do this using VBA.
    Put the ReadFormat subroutine in a general module and add a few lines to the BeforeDoubleClick event of the worksheet where your conditional formatting is defined, like this:

    <pre>Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    ReadFormat
    Cancel = True
    End Sub
    </pre>



    <pre>Sub ReadFormat()
    Dim No As Integer, i As Integer, q As String
    'Operator: xlBetween, xlEqual, xlGreater, xlGreaterEqual, xlLess, xlLessEqual,
    'xlNotBetween or xlNotEqual.
    'Type: xlCellValue or xlExpression.
    No = ActiveCell.FormatConditions.Count
    If No = 0 Then
    MsgBox "No conditional formatting"
    Exit Sub
    End If

    For i = 1 To No

    Select Case ActiveCell.FormatConditions(i).Type
    Case xlCellValue
    q = "CellValue is "
    Select Case ActiveCell.FormatConditions(i).Operator
    Case xlBetween
    q = q & "Between "
    q = q & ActiveCell.FormatConditions(i).Formula1 & " and " & _
    ActiveCell.FormatConditions(i).Formula2
    Case xlEqual
    q = q & "Equal to " & ActiveCell.FormatConditions(i).Formula1
    Case xlGreater
    q = q & "Greater than " & ActiveCell.FormatConditions(i).Formula1
    Case xlGreaterEqual
    q = q & "Greater than or equal to " & ActiveCell.FormatConditions(i).Formula1
    Case xlLess
    q = q & "Less than " & ActiveCell.FormatConditions(i).Formula1
    Case xlLessEqual
    q = q & "Less than or equal to " & ActiveCell.FormatConditions(i).Formula1
    Case xlNotBetween
    q = q & "Not between " & ActiveCell.FormatConditions(i).Formula1 & " and " & _
    ActiveCell.FormatConditions(i).Formula2
    Case xlNotEqual
    q = q & "Not equal to " & ActiveCell.FormatConditions(i).Formula1
    End Select

    Case xlExpression
    q = "Formula is " & ActiveCell.FormatConditions(i).Formula1
    End Select

    MsgBox q, vbOKOnly, "Conditional Formatting " & Str(i)
    Next i
    End Sub
    </pre>


    By doubleclicking a non-empty cell, a messagebox should appear telling you if no conditional formatting was applied or if applied, it will tell you the conditions (one messagebox per condition). I think other properties can be used to find out the actual formats (use font, interior) although, I did not try that out). I did not try out every condition, so please check it.

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Conditional formatting (XL 2000)

    Hi Hans, I'm John, I was pointing the poster to Brooke's code from a while back. I haven't looked at your code, but it looks closer to what she wants, so not to worry
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conditional formatting (XL 2000)

    John (sorry for the name mismatch, 'Brooke' deleted)

    Was I too fast? Isn't this what was asked? Must be my poor understanding of your language.
    Anyhow, this is what I understood. I just want to add that instead of using a messagebox, you could use the statusbar to print the conditions.

Posting Permissions

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