user1283776
user1283776

Reputation: 21784

Copy conditional formatting from one cell to another using VBA?

Can I copy conditional formatting from one cell to another using VBA?

I'm imagining something like:

Sheets("A").Range("A1:A10").ConditionalFormatting = Sheets("B").Range("B1").ConditionalFormatting

Upvotes: 4

Views: 26097

Answers (1)

Vasily
Vasily

Reputation: 5782

use this:

Sub test()
     Sheets("B").[B1].Copy: Sheets("A").[A1:A10].PasteSpecial xlPasteFormats
End Sub

Upvotes: 3

Related Questions