Add large ammount of formula

N

Nick

Hi,

my current excel has:

A B C
1 1
2 2
3 3
4 4
n n

I would like to let the value in column C is =Ax + Bx, where x is the
row number, but how to add this formula in a batch?

currently, i only can loop all the row and add manually :

e.g.

for i = 1 to 1000
range("C" & i ).formula = "=A" & i & "+B" & i
next

any other or faster method?

nick
 
S

Soo Cheon Jheong

Nick,

Try
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sub TEST_1()
Range("C1:C1000").Formula = "=A1+B1"
End Sub

Sub TEST_2()
Range("C1:C1000").Value = "=A1+B1"
End Sub

Sub TEST_3()
Range("C1:C1000").Formula = "=RC[-2]+RC[-1]"
End Sub

Sub TEST_4()
Range("C1:C1000").Value = "=RC[-2]+RC[-1]"
End Sub

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -


--
Regards,
Soo Cheon Jheong
_ _
^¢¯^
--
 
Top