Autofill to the left of data

G

Guest

Hi

I often use autofill in the last column of data. Now I'm trying to Autofill
column A, and the code I use just autofills to the end of the spreadsheet. I
suspect this is because I'm trying to autofill when the data is to the right
of my column rather than the left. I've pasted the two bits of code that do
the same thing and normally work for me below.

Can someone advise what I need to change to make this work?

Dim LastRow As Long
With Worksheets("CURRENT WEEK")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Range("T4").AutoFill Destination:=.Range("T4:T" & LastRow),
Type:=xlFillDefault
End With

Range("T2").Select
Selection.AutoFill Destination:=Range("T2:T" &
ActiveSheet.UsedRange.Rows.Count)

Thanks in advance for any suggestions.
 
R

Ron de Bruin

If you want to autofill column a to the last row with data in column B
then use this

With Worksheets("CURRENT WEEK")
LastRow = .Cells(Rows.Count, "B").End(xlUp).Row
Range("A4").AutoFill Destination:=.Range("A4:A" & LastRow), Type:=xlFillDefault
End With
 

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

Similar Threads


Top