MPW
Well-known Member
- Joined
- Oct 7, 2009
- Messages
- 571
- Office Version
- 365
- Platform
- Windows
Hi All,
I am using Office 2003 in XP.
I would like to capture all the specs of a cell with conditional formatting.
Would I look for each one separately, or is there a way to extract them all at once?
I know how to capture the formulas of each condition but I seem to have a problem with looking for format changes if they do not exist.
The code above will create the same formula driven conditions in Cell B1 that exists in Cell A1. What I am looking for are the rest of the components. For instance, if I try this with the font:
It will crash. I am trying not to use an on error statement, I would rather test if each condition is present.
I know that the cell could be copied but I would like to know how to do it this way if possible.
MPW
I am using Office 2003 in XP.
I would like to capture all the specs of a cell with conditional formatting.
Would I look for each one separately, or is there a way to extract them all at once?
I know how to capture the formulas of each condition but I seem to have a problem with looking for format changes if they do not exist.
Code:
If Range("A1").FormatConditions.Count <> 0 then
For i = 1 to Range("A1").FormatConditions.Count
With Range("B1")
.FormatConditions.Add Type:= _
Range("A1").FormatConditions(i).Type, _
Formula1:=Range("A1").FormatConditions(i).Formula1
end with
Next i
End If
Code:
.FormatConditions(i).Font.Name = _
Range("A1").FormatConditions(i).Font.Name
I know that the cell could be copied but I would like to know how to do it this way if possible.
MPW