Help Please! Macro to Copy formula across cells in one row!

eaykan

New Member
Joined
Mar 20, 2013
Messages
15
Hi,

I am trying to create a macro to (when run) go through all the values starting in Column c in rows 3 & 4 (spreadsheet outline below) and subtract them from each other and populate row 5, then moving onto column C and do the same and untill it reaches a column that only has data in row 3 or 4 but not both and wont proceed in the calculations until both the cells are populated.

Range("C5").Select
Range(Selection, Selection.End(xlToRight)).Select
Offset(1).FormulaR1C1 = "=R[-2]C-R[-1]C"


I have a spreadsheet as below:
1ABCDEF
2
3112
411
522
6
7
8



<colgroup><col style="width: 48pt;" span="7" width="64">
<tbody>


</tbody>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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