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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
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,223,705
Messages
6,173,996
Members
452,542
Latest member
Bricklin

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