Calculate Values and filldown

Cowichandave

New Member
Joined
Jan 18, 2009
Messages
44
Office Version
  1. 2016
L6 is the result of J6-K6. I want to calculate L6 to end of rows lr. All this formula does is copy L6 to then end of the rows so the value is always the same.
How do I change this so that it calculates each row to the end row.


Range("L6").Select

ActiveCell.FormulaR1C1 = "=+RC[-2]-RC[-1]"

Range("L7:L" & lr).Value = Range("L6").Value

Range("L7:L" & lr).FillDown
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
There's a number of ways to do this. Here's just one (assumes you've already got the value of lr)

VBA Code:
Range("L6:L" & lr).Value = Evaluate("J6:J" & lr & "-K6:K" & lr & "")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,956
Messages
6,122,465
Members
449,085
Latest member
ExcelError

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