From here I found this;
https://www.extendoffice.com/documents/excel/4805-excel-print-all-conditional-formatting-rules.html
It worked exactly as intended for the sheet I was on, (“Active Sheet”) when I first installed the “Module” and it ran for first time.
But changes to the code I’ve made, do not show “Condition Formating” for the WHOLE Workbook , how is it possible to tweek it so it will work for the whole Workbook and is listed per sheet?
A new separate sheet of “Condition Formating” for each Sheet within the Workbook would be compromise but certainly OK, it would only increase the Book size by 4 Sheets.
Either option is more than expectable compared to Pasting & Copying EVERY individual rule from ALL the desired Sheets to a Word Doc for safe keeping; as I have done in the past!!!!!!!!!!!
https://www.extendoffice.com/documents/excel/4805-excel-print-all-conditional-formatting-rules.html
VBA Code:
Sub M_snb()
Dim xRg As Range, xCell As Range
Dim xFormat As Object
Dim xFmStr, xFmAddress As String
Dim xDic As New Dictionary
Dim xSpArr, xOperatorArr
On Error Resume Next
Set xRg = ActiveSheet.Cells.SpecialCells(xlCellTypeAllFormatConditions)
If xRg Is Nothing Then Exit Sub
xDic.Item("Title") = "Type|Typename|Range|StopIfTrue|Operator|Formula1|Formula2|Formula3"If xSpArr.Count = 0 Then
xSpArr = Split("Cell Value|Expression|Color Scale|DataBar|Top 10|Icon Sets||Unique Values|Text|Blanks|Time Period|Above Average||No Blanks||Errors|No Errors|||||", "|")
xOperatorArr = Split("xlBetween|xlNotBetween|xlEqual|xlNotEqual|xlGreater|xlLess|xlGreaterEqual|xlLessEqual", "|")
End If
For Each xCell In xRg
Set xFormat = xCell.FormatConditions(1)
xFmAddress = xFormat.AppliesTo.Address
If Not xDic.Exists(xFmAddress) Then
xDic.Item(xFmAddress) = xFormat.Type & "|" & xSpArr(xFormat.Type - 1) & "|" & xFmAddress & "|" & xFormat.StopIfTrue
If Not IsEmpty(xFormat.Operator) Then
xDic.Item(xFmAddress) = xDic.Item(xFmAddress) & "|" & xOperatorArr(xFormat.Operator - 1)
End If
If Not IsEmpty(xFormat.Formula1) Then
xDic.Item(xFmAddress) = xDic.Item(xFmAddress) & "|'" & xFormat.Formula1
End If
End If
Next
If ActiveWorkbook.Worksheets("FmCondictionList") Is Nothing Then
Sheets.Add.Name = "FmCondictionList"
End If
Sheets("FmCondictionList").Cells(1).Resize(xDic.Count) = Application.Transpose(xDic.items)
Sheets("FmCondictionList").Columns(1).TextToColumns , , , , 0, 0, 0, 0, -1, "|
End Sub
It worked exactly as intended for the sheet I was on, (“Active Sheet”) when I first installed the “Module” and it ran for first time.
But changes to the code I’ve made, do not show “Condition Formating” for the WHOLE Workbook , how is it possible to tweek it so it will work for the whole Workbook and is listed per sheet?
A new separate sheet of “Condition Formating” for each Sheet within the Workbook would be compromise but certainly OK, it would only increase the Book size by 4 Sheets.
Either option is more than expectable compared to Pasting & Copying EVERY individual rule from ALL the desired Sheets to a Word Doc for safe keeping; as I have done in the past!!!!!!!!!!!