+ Reply to Thread
Results 1 to 3 of 3

Using ranges from different sheets in a subroutine

  1. #1
    Registered User
    Join Date
    01-19-2010
    Location
    Antwerp,Belgium
    MS-Off Ver
    Excel 2003
    Posts
    16

    Using ranges from different sheets in a subroutine

    Hello,

    I have a subroutine "MATRIXCALC" that takes two matrices as input. I have predefined two ranges in excel: "Matrix1" and "Matrix2", but Matrix1 is located in sheet1 and Matrix2 in sheet2.

    I would like to call this subroutine by a button placed on sheet1 with the following code:
    Please Login or Register  to view this content.

    If I run this code, I get the message "Method 'Range' of object '_Worksheet' failed".

    Is there a way to call different ranges from different sheets?

    Thank you!
    Last edited by Lanox; 07-27-2010 at 09:01 AM. Reason: problem solved

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Using ranges from different sheets in a subroutine

    Yes - specify the sheet:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    01-19-2010
    Location
    Antwerp,Belgium
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Using ranges from different sheets in a subroutine

    Solved.

    Thanks romperstomper!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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