Forum Discussion
Conditional Formating copy VBA
I would like you to understand. there are no values in the cells of the file in which the rule is stored - conditional formatting in this case cannot be picked up by the Range method or any other method applicable to the cells
Formatting (including conditional formatting) can be copied/pasted regardless of whether a cell contains a value (or formula) or not...
- 666_666666May 26, 2023Copper Contributor
could you give an example of the code
accessing the file.xltx
copying a rule
from there and applying it to a previously opened sheet of the book.xlsmthe fact is that I have already tried, either I don't know something, or you have a different version, not 2016 excel
- HansVogelaarMay 26, 2023MVP
From which sheet and which range in file.xltx do you want to copy the formatting to which sheet and which range in book.xlsm?
- 666_666666May 26, 2023Copper Contributor
From what sheet
1st
and in what range
is all
in the file.xlsx do you want to copy
formatting to which sheet
1st
and in what rangeis all
in book.xlsm?
in .xltx I have a rule that applies to the entire sheet
XML code from .xltx
...
- <conditionalFormatting sqref="A1:XFD1048576">
- <cfRule priority="1" dxfId="0" type="expression">
<formula>xxx</formula>
</cfRule>
</conditionalFormatting>
...