View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default calculate a correlation with ranges

dim correlation as range
set correlation = Range("A1")
correlation.Formula = "=correl(inSerie" & i & ",inSerie" & j & ")"

--
Regards,
Tom Ogilvy


"Paco" wrote:

All i need is to calculate a correlation of two ranges and assign it to a
variable. I tried this but i get an 91 error (object or with block not set):

dim correlation as range
Set correlation.Formula = "=correl(inSerie" & i & ",inSerie" & j & ")"

but, if i replace "correlation" by range("a1"), then it works fine.