Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
in C1 enter =A1+B1 and just copy down -- Regards Frank Kabel Frankfurt, Germany Nick wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
yes, i know, but i would like to do it using vba
Frank Kabel wrote: Hi in C1 enter =A1+B1 and just copy down -- Regards Frank Kabel Frankfurt, Germany Nick wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range("C1:C1000").Formula = "=A1+B1"
Excel will adjust the row numbers for you. -- Regards, Tom Ogilvy "Nick" wrote in message ... yes, i know, but i would like to do it using vba Frank Kabel wrote: Hi in C1 enter =A1+B1 and just copy down -- Regards Frank Kabel Frankfurt, Germany Nick wrote: 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 _ _ ^ąŻ^ -- |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks all .
Thanks Nick Soo Cheon Jheong wrote: 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 _ _ ^ąŻ^ -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Large formula | Excel Worksheet Functions | |||
Formula too large | Excel Discussion (Misc queries) | |||
How many chart types does excel have: please exact ammount? | Charts and Charting in Excel | |||
How many chart types does excel have: please exact ammount? | Excel Discussion (Misc queries) | |||
Program colunm to switch receievable ammount from 30 to 60 days | Excel Discussion (Misc queries) |