Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dave Breitenbach
 
Posts: n/a
Default list all conditional formats

Is there a way to show all conditional formats within a spreadsheet, maybe in
a range of cells in a sheet?

tia,
Dave
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Dave,

One approach

Option Explicit

'---------------------------------------------------------------------------
Public Sub CFHighlight()
'---------------------------------------------------------------------------
Dim oShape As Shape
Dim cell As Range
Dim fc As Long
Dim dTop As Double
Dim dLeft As Double
Dim dWidth As Double
Dim dHeight As Double
Dim iTxtSize As Long
Dim iArea As Integer


With ActiveSheet
For Each oShape In .Shapes
If Left(oShape.Name, 9) = "CFPlus - " Then
oShape.Delete
End If
Next oShape

iArea = 0
For Each cell In .UsedRange

fc = 0
On Error Resume Next
fc = cell.FormatConditions(1).Type
On Error GoTo 0
If fc < 0 Then
dTop = cell.Top
dLeft = cell.Left
dWidth = cell.Width
dHeight = cell.Height
iTxtSize = CInt(Application.Min(36, Application.Max( _
Application.Min(dWidth /
2, dHeight / 30), 8)))

Set oShape =
..Shapes.AddTextbox(msoTextOrientationHorizontal, dLeft, _
dTop, dWidth, dHeight)
With oShape
.Name = "CFPlus - " & iArea
.Fill.ForeColor.SchemeColor = 13
.Fill.Transparency = 0.9
.OnAction = "CFHighlightShow"
With .TextFrame
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
If dWidth dHeight Then
.Orientation = msoTextOrientationHorizontal
Else
.Orientation = msoTextOrientationUpward
End If
.AutoSize = False
End With
With .Line
.Weight = 1#
.DashStyle = msoLineDash
.Style = msoLineSquareDot
.Transparency = 0#
.Visible = msoTrue
.ForeColor.SchemeColor = 54
.BackColor.RGB = RGB(255, 255, 255)
End With
With .TextFrame.Characters(1,
..TextFrame.Characters.Count).Font
.Name = "Arial"
.Size = iTxtSize
.Underline = xlUnderlineStyleNone
.ColorIndex = 34
End With
End With
iArea = iArea + 1
End If
Next cell
End With

'Clear variables
Set oShape = Nothing
End Sub


Sub CFHighlightShow()
MsgBox ActiveCell.Address
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dave Breitenbach" wrote in
message ...
Is there a way to show all conditional formats within a spreadsheet, maybe

in
a range of cells in a sheet?

tia,
Dave



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic updating of Conditional Formats using dates MAD Excel Worksheet Functions 5 May 3rd 05 04:44 AM
How do I do conditional formatting on number formats not patterns. dave55 Excel Discussion (Misc queries) 2 March 22nd 05 02:21 AM
Excel conditional formats Eric Hudson Excel Discussion (Misc queries) 4 March 6th 05 05:15 AM
how do I apply more than 3 conditional formats in excel chetwyndthomas Excel Discussion (Misc queries) 1 January 30th 05 04:24 PM
Conditional Formats in Excel DaveB Excel Worksheet Functions 2 November 15th 04 07:36 AM


All times are GMT +1. The time now is 12:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"