Thread: Two questions
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Two questions

Write it to a range on the worksheet and then pass that.

--
Regards,
Tom Ogilvy


"P. Dileepan" wrote in message
...

-----Original Message-----
Re. Question [2]:

The Regress sub only takes ranges, hence the dialog that

states
"Regression - Input Y range must be a contiguous

reference" if you try
to pass it an array.


Thank you for answering my questions. I have a followup.

How can I pass an array as a range? Here is a sample
code:
============================
For i = 1 To n
X(i, 1) = i
X(i, 2) = i*i
Next

AddIns("Analysis ToolPak - VBA").Installed = True
Application.Run "ATPVBAEN.XLA!Regress", Range
(dataRange), _
X, False, False, , "temp", False, False, _
False, False, , False
==============================

The y-range is fine, but X is an array and I am getting
an error. How can I pass X as a "contiguous reference"?

Thank you,

-- Dileepan