Results 1 to 2 of 2

Thread: WorksheetFunction.MInverse Method

  1. #1
    Senior Member
    Join Date
    Apr 2011
    Posts
    190
    Rep Power
    14

    WorksheetFunction.MInverse Method

    I am inverting a matrix - but it seems that it only works if my first element is XTX(1,1) - in other words Option Base 1 - can anybody confirm if that is true or not. Below is my code - in order to get it working - I had to make the array XTX start with element 1 - if I use option base zero it generates an error. I know the simple answer is to just use option base 1 - however all my other arrays are zero based. So what a mess if arrays are different starting point.

    I am starting to think that I should use option base 1 - period - it seems Excel sometimes support both - but always support option base 1.


    Code:
    For XX = 0 To NumVal - 1
        For XXX = 0 To NumVal - 1
            InvXTX(XX, XXX) = Application.Index((Application.MInverse(XTX)), XX + 1, XXX + 1)
        Next XXX
    Next XX
    Last edited by Rasm; 12-06-2011 at 02:14 AM.
    xl2007 - Windows 7
    xl hates the 255 number

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Split and Filter will return a zero based array irrespective of Option base statement. Otherwise as my thinking is that you have to write Option base statement to declare the default lower bound for array subscripts.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Worksheet Protection Method with UserInterfaceOnly Argument
    By technicalupload in forum Download Center
    Replies: 1
    Last Post: 09-02-2011, 04:17 PM
  2. Class Objects Created Using the CreateObject Method That Employs Late Binding
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 08-16-2011, 12:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •