Formula R1C1 going all the way to bottom

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
946
Office Version
  1. 2016
Platform
  1. Windows
Hello All
I have the below from the recorder. The problem, is the formula computes all the way to the bottom, and my data ends much sooner, so the program really slows down.
How do I have the formula compute to the end of cells that it is requiring? For example if in this example, the formula is only grabbing numbers from columns E& F, down to row 3200 (this will be different every time I load new raw data) how can it stop at 3200, instead of going all the way down?
Thanks for the help



VBA Code:
Range("I2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=RC[-3]-RC[-4]"
Range("I2").Copy
Range("I3").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Paste
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Changing this
VBA Code:
Selection.End(xlDown)
to
3200

AND

Why don't use this:
VBA Code:
Sub Test()
Range("I2:I3200").Formula = "=F2-E2"
End Sub
 
Last edited:
Upvote 0
Try
VBA Code:
Range("I2:I" & Range("E" & Rows.Count).End(xlUp).Row).FormulaR1C1 = "=RC[-3]-RC[-4]"
This will insert the formula from I2 to the last row in col E
 
Upvote 0
Try
VBA Code:
Range("I2:I" & Range("E" & Rows.Count).End(xlUp).Row).FormulaR1C1 = "=RC[-3]-RC[-4]"
This will insert the formula from I2 to the last row in col E
OK...This did work good, and sped thanks up drastically! Thank you very much
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

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