+ Reply to Thread
Results 1 to 4 of 4

Need help with inverse matrix

  1. #1
    Registered User
    Join Date
    04-04-2012
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    2

    Need help with inverse matrix

    Hey there,
    I am writing a structural analysis code and I need to be able to do some basic matrix manipulations. I put something together to try and accomplish this using the MInverse function but for some reason I continue to get "Run-time error 1004, Application-defined or Object-defined error", I believe that my spelling is correct, and it seems as though nothing is being stored on the variable "dof_number", the error occurs first on line 12:

    here is a copy of the code segment:

    Sub Matrix_Inverse()

    Sheets("Input").Activate
    dof_number = Worksheets("Input").Range("DOF_NUMBER1").Value

    Sheets("Inverse").Activate
    Worksheets("inverse").Cells.Clear


    Sheets("Structure").Activate

    Worksheets("Structure").Range(Cells(3, 3), Cells(dof_number + 2, dof_number + 2)).Name = "stiff_matrix"
    Sheets("Inverse").Activate
    Worksheets("Inverse").Range(Cells(4, 2), Cells(dof_number + 3, dof_number + 1)).Select
    Selection.FormulaArray = "=minverse(stiff_matrix)"
    End Sub

    .
    no clue what's going on. I would love to figure this one out.
    Excel inputs 5043.xlsm

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need help with inverse matrix

    Welcome to the forum.

    I don't see a range named DOF_NUMBER1
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-04-2012
    Location
    canada
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Need help with inverse matrix

    Excel inputs 5043.xlsm
    Highlighted it on this version, it is on the Input page.

    thanks for the welcome.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need help with inverse matrix

    In this,

    Please Login or Register  to view this content.
    ... the two Cells references are unqualified and therfore refer to the active worksheet.

    One way among many to correct:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1