Need Sample VBA Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a cell (A3) with conditional formatting.

Via VBA code, I want to be able to say "Make the conditional formatting for
cells A6 through A500 the same as the conditional formatting for cell A3".
 
Sub ABCD()
Range("A3").Copy
Range("A6:A500").PasteSpecial xlPasteFormats

End Sub

Copies all the formatting from Cell A3 including the Conditional formatting.
 
apply the following code to every cell you need to

Range("a3").Copy
Range("A6").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

or if the conditional formatting will always be the same

lookup formatcondition, in the help index to program the format conditions
directly
(xl2003)
 
I have a cell (A3) with conditional formatting.

Via VBA code, I want to be able to say "Make the conditional formatting for
cells A6 through A500 the same as the conditional formatting for cell A3".

Try this

Range("A3").Select
Selection.Copy
Range("A6:A500").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Hope this works as expected.

Lars-Åke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top