• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Extend down range formatting

Pierre

Member
Hello,
I would like to extend down (until last filled cell) the formatting of range A2:C2. When I record macro I have the following:

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

What would be the best way to do it without using a Select statement?
 
Code:
Sub foo()
Dim lr As Long
lr = Range("A" & Rows.Count).End(xlUp).Row
Range("A2:C2").Copy
Range("A2:A" & lr).PasteSpecial xlPasteFormats
End Sub
 
Back
Top