Macro to drag formula from Activecell to last row used

taostep1

Board Regular
Joined
May 18, 2016
Messages
65
I am stuck on figuring out on how to fill down my formulas from the activecell selection to the last row used in column AK. Please keep in mind that the active cell can always be in a different spot of the excel spreadsheet.

Dim LRw As Long


ActiveCell.Select
ActiveCell.Formula = "1"
LRw = Range("AK" & Rows.Count).End(xlUp).Row


Range(ActiveCell, LRw).FillDown
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Here is one way, using the logic you are trying to incorporate:
Code:
Sub MyFillMacro()

    Dim LRw As Long

    ActiveCell.Formula = "1"
    LRw = Range("AK" & Rows.Count).End(xlUp).Row

    Range(ActiveCell, Cells(LRw, ActiveCell.Column)).FillDown

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,265
Members
449,219
Latest member
daynle

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