visual basic pasting formulae

  • Thread starter Thread starter bob
  • Start date Start date
B

bob

writing a macro which pastes a formula into a cell (r,c)
to equal the value of a cell in another sheet (rr,cc)
then r=r+1, rr=rr+1 and repeat this in a loop count =1,
until count =4 then r=r+1 (still) but rr=rr+4 and count
is reset to count =1

the count bit is no problem but i cant get it to paste
the formula, i believe the vba code to paste the formula
is: ActiveCell.Formula = "=Sheet4!(rr+2,cc+1)"

Please help
 
I didn't exatly follow your logic but to paste a cell I use


activecell.value=sheets("Sheet 4").cells(rr+2,cc+1)

This assumes the data is in a common workbook otherwise ...

activecell.value=workbooks("book2.xls").sheets("Shee
4").cells(rr+2,cc+1)

Hope this help
 

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

Similar Threads


Back
Top