Forum Discussion
Conditional Formating copy VBA
Copying only conditional formatting would be complicated.
Copying all formatting, including conditional formatting, is doable - copy the source range and paste special with xlPasteFormats to the target range. But if you have rules that refer to other cells than the ones being formatted, the result might be unpredictable.
- 666_666666May 25, 2023Copper Contributor
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
- HansVogelaarMay 26, 2023MVP
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