ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   looping with formula inside (https://www.excelbanter.com/excel-programming/280636-looping-formula-inside.html)

a.ekster

looping with formula inside
 
i have problem with the following code
could anybody help?thanks in advance
a =worksheets"sheet1".range"a1"
b =worksheets"sheet2"."range a2"
for i to x
a.formula= "= 2*b"
a=offset(0,i)
b=offset(0,i)
alex

Tom Ogilvy

looping with formula inside
 
Dim as as Range, b as Range
Dim x as Long, i as long
Set a =worksheets("sheet1").range("a1")
set b =worksheets("sheet2").range("a2")

x = 10
for i to x
a.formula= "= 2*" & b.Address(external:=True)
set a=a.offset(0,1)
set b=b.offset(0,1)
Next

--
Regards,
Tom Ogilvy



a.ekster wrote in message
...
i have problem with the following code
could anybody help?thanks in advance
a =worksheets"sheet1".range"a1"
b =worksheets"sheet2"."range a2"
for i to x
a.formula= "= 2*b"
a=offset(0,i)
b=offset(0,i)
alex





All times are GMT +1. The time now is 04:17 AM.

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