ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   add formula next to corresponding cells (https://www.excelbanter.com/excel-programming/393760-add-formula-next-corresponding-cells.html)

[email protected]

add formula next to corresponding cells
 
I would like to add the following formula "=SUM(RC[1]:RC[2])" in cells
starting H2 to H10 next to cell G2:G10

row 10 can vary - i,e adding the following formula "=SUM(RC[1]:RC[2])"
in cells starting H2 to H100 next to cell G2:G100

Can any bod help

(i,e i would like to offset 1 column & add formula next to
corresponding cells.

Thxs


Bob Phillips

add formula next to corresponding cells
 
Dim nRow As Long
nRow = 10
Range("H2:H" & nRow).FormulaR1C1 = "=SUM(RC[1]:RC[2])"


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
ups.com...
I would like to add the following formula "=SUM(RC[1]:RC[2])" in cells
starting H2 to H10 next to cell G2:G10

row 10 can vary - i,e adding the following formula "=SUM(RC[1]:RC[2])"
in cells starting H2 to H100 next to cell G2:G100

Can any bod help

(i,e i would like to offset 1 column & add formula next to
corresponding cells.

Thxs





All times are GMT +1. The time now is 10:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com