Copy Rows based on count of last row of another Column

T

Thomp

Hi..I found this code on the web and it works great I just need to
find a way to expand it to all the other columns without having to
copy it some 26 times for each new column I want copied..Need help
understanding how to write the code so I can do this once for all my
columns that go all the way to BK

Public Sub filldown()
Dim LRow As Integer
LRow = Range("B" & Rows.Count).End(xlUp).Row
Range("A3").Select
Selection.AutoFill Destination:=Range("A3:A" & LRow),
Type:=xlFillDefault
Range("C3").Select
Selection.AutoFill Destination:=Range("C3:C" & LRow),
Type:=xlFillDefault
End Sub
 
T

Thomp

Hi..I found this code on the web and it works great I just need to
find a way to expand it to all the other columns without having to
copy it some 26 times for each new column I want copied..Need help
understanding how to write the code so I can do this once for all my
columns that go all the way to BK

Public Sub filldown()
    Dim LRow As Integer
        LRow = Range("B" & Rows.Count).End(xlUp).Row
        Range("A3").Select
        Selection.AutoFill Destination:=Range("A3:A" & LRow),
Type:=xlFillDefault
        Range("C3").Select
        Selection.AutoFill Destination:=Range("C3:C" & LRow),
Type:=xlFillDefault
End Sub

Hey Everyone..Figured it out..thanks anyway..Just needed to change
Range to C3:Bk3 and Autofill to C3:BK
 

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

Top