paste cells with reference

  • Thread starter Thread starter HaiderMKhan
  • Start date Start date
H

HaiderMKhan

I am trying to programitically copy a group of cells that contain a
formula into another group of cells, i want the copied cells to keep
there reference when they are pasted. please note that i cant use $
signs since i am doing this programitically.

thanks!
 
Hello,

Did you try the following:

' let's say Range("A1:A20") is the set of cells with the formula you want
' and Range("D10:D18") is the set of cells to copy to.

Range("D10:D18").FormulaR1C1 = Range("A1:A20").FormulaR1C1

The FormulaR1C1 property preserves the relative locations.

Chad
 

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

Back
Top