how to change range in VBA?

  • Thread starter Thread starter Nazrul
  • Start date Start date
N

Nazrul

I use the following code to calculate correlation
coefficient and write it to a cell:
--------------------------------------------
Sheets("sheet1").Cells(4, 3) = "=correl
(R1C1:R5C1,R1C2:R5C2)"
--------------------------------------------
However, I would like to change the cell references
programmatically. For example,next cell reference
(R1C3:R5C4, R1C5:R5C5)and so on.

How can I do that?
 
Nazrul,

as the row and column values are numbers, if you can define a pattern (or
even if you can't) you can assign each R and C value a variable and then
alter the variable.

Steve
 
Back
Top