looping with formula inside

A

a.ekster

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
 
T

Tom Ogilvy

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
 

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