Copy formula to end? Macro

MCosca

New Member
Joined
Jul 21, 2017
Messages
23
This is probably so simple and I apologize in advance for not being able to locate the precise reply to my problem as I have searched for this.

I have formulas in K2 & L2 that I need to copy to the end of the columns each month in my spreadsheet. Since it is a monthly spreadsheet the amount of rows differs each month. The way I have it written currently it is taking an extremely long time to copy the formulas down to the end of the data. There is data in column N, O, etc.

How do I copy this formula to the end of the current data each month?

Here is the VB info - I need this to go from K2:L (end of current data)

Range("K2:L2").Select
Selection.AutoFill Destination:=Range("K2:L32748")
Range("K2:L32748").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Which column can be used to determine the last row of data?
 
Upvote 0
Which column can be used to determine the last row of data?
Column A or B or C (not sure if it matters for the column to be adjacent to K or L or not)

Thank you so much - I feel silly asking because its going to look like it was so easy to fix after Im shown the means to do so
 
Upvote 0
Ok, how about
VBA Code:
   With Range("K2:L" & Range("A" & Rows.count).End(xlUp).Row)
      .FillDown
      .Value = .Value
   End With
 
Upvote 0
Solution
look like that solves the issue! Thank you again, I really appreciate the helpful folks here on this site as you all have bailed me out of some jams over the years!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,757
Members
449,094
Latest member
dsharae57

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