View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nazrul Nazrul is offline
external usenet poster
 
Posts: 3
Default how to change range in VBA?

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?