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
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

drsarao

Well-known Member
Joined
Sep 9, 2009
Messages
1,143
Office Version
  1. 2007
Platform
  1. Windows
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
 

Aussie Grid

New Member
Joined
Jan 14, 2010
Messages
47
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
 

drsarao

Well-known Member
Joined
Sep 9, 2009
Messages
1,143
Office Version
  1. 2007
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,229
Messages
5,594,944
Members
413,953
Latest member
Arthur1471

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
Top