+ Reply to Thread
Results 1 to 3 of 3

[SOLVED] Type Mismatch 13 - setting worksheet to another worksheet not working

  1. #1
    Registered User
    Join Date
    01-03-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    17

    [SOLVED] Type Mismatch 13 - setting worksheet to another worksheet not working

    Dear forum members,

    I receive a runtime error 13 (type mismatch) when I try to set a worksheet to another worksheet; the code

    Please Login or Register  to view this content.
    gets highlighted. I am a novice when it comes to VBA; I have coded quite a bit of MATLAB and Python though, so I have an understanding for algorithm theory.
    Your help in finding why Excel thinks the two worksheets are incompatible is highly appreciated.

    The code in its entirity is a bit too long for this thread; I have attached it as a file instead.
    Attached Files Attached Files
    Last edited by nErD; 01-04-2012 at 07:09 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Type Mismatch 13 - setting worksheet to another worksheet not working

    I think that From_Sheet_SDE should be defined as worksheet object, not a worksheets object and, because you want a single sheet, your set statement should be:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-03-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Type Mismatch 13 - setting worksheet to another worksheet not working

    Andrew, that most certainly did the trick! Thank you very much, my problem is now solved.

    I changed:
    1. in the difinitions, Worksheets to Worksheet and
    2. in the code quoted above, Worksheets to Sheets

+ 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