Formula is not working

J

jesmin

Hi There: New bee.
I have data like:
A------B-----C----D-----E----F------G H I
1990--1-----------3-------6---------8
1991--1-----------9-------2---------7
1992--2-----------5-------7---------1

Col C will have data diff(G1990-B1991).That means for previous year.
I was trying:
range("c2:c3").formular1c1 = "=RC[4].offset(-1,0) - RC[-1]"
--Not working,Having application error

I will try the following way. But its too long. I need to use a rang
and a formula(if possible).
cell(2,3).value = cell(2,3).offset(-1,3).value
cell(2,3).offset(0,-1).value
cell(3,3).value = cell(3,3).offset(-1,3).value
cell(3,3).offset(0,-1).value
Thanks in advance
Jesmi
 
J

jesmin

Hi: I want to deduct the data in col. B from data in col. G and then put
the deducted result in col C. But col B data of 1991 will be deducted
from col G data of 1990. For example:

cell(2,3).value
= cell(2,3).offset(-1,4).value - cell(2,3).offset(0,-1).value
A------B-----C----D-----E----F------G H I
1990--1----------3----------6-------8
1991--1----------9----------2-------7
1992--2----------5----------7-------1

I want to do it with a range and formula. Something like:
range("c2:c3").formular1c1 = "=RC[4].offset(-1,0) - RC[-1]"
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top