View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Henry Stockbridge Henry Stockbridge is offline
external usenet poster
 
Posts: 19
Default Copying Conditional Formatting Fails

Hi,

When I attempt to copy the conditional formatting of the following, it
does not copy correctly.

a b c
1 First MI Last
2 Jack M Harris
3 Sally J Smith
4 Bill V Nelson

Cells A2 - C2 have conditional formatting applied to them. I have
attempted to Copy - Paste Special -- Formats, but this code fails:

Range("A1:C1").Select
Selection.Copy
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A2:C4").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

I will be calculating the row count via code (I don't have that handy)
so the absolute reference to C4 will be replaced with C & rowcount.

Any help you can lend would be appreciated.

Henry