Autofill Current/Active Column

Vylent Fyre

New Member
Joined
Sep 5, 2012
Messages
3
I have a workbook that will have over 20+ tabs and I am wanting to build a macro to do an autofill to last active cell in the current column I have selected. What is the correct code? I have this currently but it doesn't work (obviously :)) The only thing consistent will be that the formulas I will need to copy down the whole column will always start in the 12th cell (of the selected column)


Range(ActiveCell.Column).AutoFill Destination:=Range(ActiveCell.Column & _
Cells(Rows.Count, "C").End(xlUp).Row)

I don't want to be forced to specify the Columns... It would require way too much work.

I have a Wend and LOOP macro built for other things, but not sure I can do this for all tabs since the columns I will need to autofill will be different for each tab.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Perhaps

Code:
LR = Cells(Rows.Count, "C").End(xlUp).Row
ActiveCell.AutoFill Destination:=Range(ActiveCell.Address & ":" & Cells(LR, ActiveCell.Column).Address)
 
Upvote 0
It shouldn't be using column C at all - I have that from a previously used formula... Could be partly why the code doesn't work. :cool:
 
Upvote 0
Then maybe

Code:
LR = Cells.Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
ActiveCell.AutoFill Destination:=Range(ActiveCell.Address & ":" & Cells(LR, ActiveCell.Column).Address)
 
Upvote 0

Forum statistics

Threads
1,223,262
Messages
6,171,080
Members
452,377
Latest member
bradfordsam

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