Auto fill across from last cell used

Aussie Grid

New Member
Joined
Jan 14, 2010
Messages
47
I need to auto fill from the last found cell across to "IV".
I have dates in rows 1,2,3 and formulas to fill from row 6 to 10.
The last cell is unknown as data is deleted from "B" to wherever depending on the days in the month, and I then need to auto fill from the last cell across.Essentially I'm creating a continuous sheet of dates with data entered down according to the date.

Any and all help appreciated
Aussie Grid
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try this:

Sub AutoFiller()
lc = Cells(1, Columns.Count).End(xlToLeft).Column 'last non-empty column
Range(Cells(1, lc), Cells(3, lc)).AutoFill Range(Cells(1, lc), Cells(3, "IV")), xlFillDays 'rows 1-3 dates
Range(Cells(6, lc), Cells(10, lc)).AutoFill Range(Cells(6, lc), Cells(10, "IV")), xlFillSeries 'rows 6-10 formulae
End Sub
 
Upvote 0
Thanks for the reply. I was unable to get it working as line 2 gave me an application or object fault. Anyway have decided on a work around.
Again TKU

Aussie Grid
 
Upvote 0
Thanks for the reply. I was unable to get it working as line 2 gave me an application or object fault. Anyway have decided on a work around.
Again TKU

Aussie Grid

Maybe not all rows 1 to 3 are dates. Change xlFillDays in the code to xlFillSeries.

Sub AutoFiller()
lc = Cells(1, Columns.Count).End(xlToLeft).Column 'last non-empty column
Range(Cells(1, lc), Cells(3, lc)).AutoFill Range(Cells(1, lc), Cells(3, "IV")), xlFillDays 'rows 1-3 dates
Range(Cells(6, lc), Cells(10, lc)).AutoFill Range(Cells(6, lc), Cells(10, "IV")), xlFillSeries 'rows 6-10 formulae
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,449
Members
448,966
Latest member
DannyC96

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top