PC Review


Reply
Thread Tools Rate Thread

Copy Rows based on count of last row of another Column

 
 
Thomp
Guest
Posts: n/a
 
      19th Mar 2012
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

 
Reply With Quote
 
 
 
 
Thomp
Guest
Posts: n/a
 
      19th Mar 2012
On Mar 19, 1:54*pm, Thomp <williamth...@gmail.com> wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy last row from sheet 1 to last row in sheet 2 =?Utf-8?B?Q2FybGVl?= Microsoft Excel Programming 4 8th Jul 2007 02:39 AM
The best sub for last row / last column / last cell? =?Utf-8?B?anVzdG1l?= Microsoft Excel Programming 15 2nd Feb 2007 05:05 AM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row >> look MPSingley@midamerican.com Microsoft Excel Programming 2 30th Dec 2006 07:23 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row >> look MPSingley@midamerican.com Microsoft Excel Misc 0 27th Dec 2006 05:31 PM
Fill down to last row - copy formula to last row =?Utf-8?B?VGltVA==?= Microsoft Excel Programming 2 6th Oct 2006 04:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:31 AM.