Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Error Converting Passed Range into Array in VBA for Excel

Your code (not counting the last bits that I don't have) worked ok for me.

Are you sure you're passing the range from the correct worksheet?

Kurt M. Sanger wrote:

For years I've been passing ranges into Excel functions, then converting them
into an array so that I can use them. But today I'm getting an empty array
instead of a full one. If I pass in a 4x4 array my function seems to work.
But when I pass in a 27x10 array I get nada. After the assignment "arrX =
arrayXIn.Value" the debugger shows arrX is the correct size but its empty.
Here's my code. Any suggestions?

Public Function funcExcelGenXXInv(arrayXIn As Range)
Dim arrX As Variant '27 x 10
Dim arrayXPrime As Variant '10 x 27
Dim arrayXpX As Variant '10 x 10
Dim arrayXpXInv As Variant '10 x 10
Dim intNRows, intNCols As Integer

arrX = arrayXIn.Value
'Find size of X array.
intNRows = UBound(arrX, 1)
intNCols = UBound(arrX, 2)

arrayXPrime = funcTranspose(arrX)
arrayXpX = funcMultM(arrayXPrime, arrX)
arrayXpXInv = funcInvMatrix(arrayXpX)
funcExcelGenXXInv = arrayXpXInv
End Function


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Message: NULL IDispatch passed to Autowrap() Aviral Sharma Excel Discussion (Misc queries) 0 March 13th 09 05:13 AM
Redim 2D Array Subscript Out Of Range Error lopsided[_10_] Excel Programming 6 February 11th 04 08:24 AM
Subscript Out of Range error in Array... Kevin Lyons Excel Programming 3 February 4th 04 06:17 PM
Converting Range.value(error) vikrampn[_2_] Excel Programming 1 December 18th 03 12:03 AM
Find size of array passed to user-defined function Cliff[_2_] Excel Programming 2 October 21st 03 02:09 AM


All times are GMT +1. The time now is 06:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"