I am currently trying to generate a report from a template now. There are multiple conditional formatting applied on the template and I want to copy and apply the conditional formatting to different columns.
For example,
The conditional formatting were applied on the template Range("A1:A9")
The criteria is that if Range("C1") >1, Range("A1") background will become white.
I wanna apply the same idea, eg. Range("D1") will format depending on Range("F1")'s value, to multiple columns.
I have tried to copy and pastespecial xlpasteformats to others ranges. It works if I copy and paste format column by column.
However, there are a few hundred of columns needed to be applied for CF. Copy and Pastespecial column by column will take very long time.
Instead, I copy the from Range("A1:A9") and paste it to the multiple columns by once, eg Range("D1:D9,G1:G9".....) .
The problem comes now. The CF are not pasted as I wanted.
For Range("D1:D9"), the CF depends on the Range("F1:F9") the first column is alright
For Range("G1:G9"), the CF depends on the Range("F1:F9") the CF for second column should depend on Range("K1:K9") instead.
If there is any way that I can copy and paste the CF in an efficient way.
Bookmarks