Macro to Reset formulas in a column

HJSmith

New Member
Joined
Jul 22, 2021
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
Hi all,

I'm new to VBA so trying to learn as much as I can but I'm stuck on this one.
I'm trying to create a macro that when the appropriate button is pressed, resets the formulas in a column that have been overtyped.
I can do this for a single cell, though I want to create one that performs along the lines of:
T5 = I5 - J5
T6 = I6 - J6
T7 = I7 - J7....

and so on.

Any help is vastly appreciated
Regards
H
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi & welcome to MrExcel.
How about
VBA Code:
Sub HJSmith()
   Range("T5", Range("T" & Rows.Count).End(xlUp)).FormulaR1C1 = "=rc[-11]-rc[-10]"
End Sub
 
Upvote 0
Solution
Hi & welcome to MrExcel.
How about
VBA Code:
Sub HJSmith()
   Range("T5", Range("T" & Rows.Count).End(xlUp)).FormulaR1C1 = "=rc[-11]-rc[-10]"
End Sub
Thank you for the welcome and the prompt reply.
That worked perfectly, thank you! :)
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,530
Members
448,969
Latest member
mirek8991

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