+ Reply to Thread
Results 1 to 8 of 8

Run-Time Error 13 - Type Mismatched when calling sub

  1. #1
    Forum Contributor
    Join Date
    12-06-2020
    Location
    Adelaide
    MS-Off Ver
    MS Office 365
    Posts
    108

    Run-Time Error 13 - Type Mismatched when calling sub

    Hi,

    I have having issues where I call and sub that I am sending it two variables.

    I receive the error message Run-Time error 13.

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.

    I have attached my two spreadsheets. The file to open is TestBook1.xlsm. Sorry, if what I have written so far is a bit of mess. I am learning and there is a bit of trial and error.

    thanks,
    Attached Files Attached Files
    Last edited by Oberon70; 02-11-2022 at 09:21 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,333

    Re: Run-Time Error 13 - Type Mismatched when calling sub

    Please fix your code tags - you need to REMOVE the second [ from the closing tag in each case and change the \ to /. Thanks.

    Thread is about to be moved to the VBA section.

    EDIT: Thanks!
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: Run-Time Error 13 - Type Mismatched when calling sub

    Should probably be Worksheet rather than Sheets
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Run-Time Error 13 - Type Mismatched when calling sub

    Remove the brackets unless you are calling a function

    Copy_Sheet ws2, ws3_Data

  5. #5
    Forum Contributor
    Join Date
    12-06-2020
    Location
    Adelaide
    MS-Off Ver
    MS Office 365
    Posts
    108

    Re: Run-Time Error 13 - Type Mismatched when calling sub

    Quote Originally Posted by TMS View Post
    Should probably be Worksheet rather than Sheets
    Sorry, and Thanks.

  6. #6
    Forum Contributor
    Join Date
    12-06-2020
    Location
    Adelaide
    MS-Off Ver
    MS Office 365
    Posts
    108

    Re: Run-Time Error 13 - Type Mismatched when calling sub

    Quote Originally Posted by AB33 View Post
    Remove the brackets unless you are calling a function

    Copy_Sheet ws2, ws3_Data
    Thank you. I will edit it in the morning. This is what happens when it is 1 am and I am tired and rushing.

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,467

    Re: Run-Time Error 13 - Type Mismatched when calling sub

    Hi there,

    Knee-jerk response:

    Please Login or Register  to view this content.
    Sheets is a Collection, not a Sheet object - I imagine you should be using Sheet or Worksheet.

    Hope this helps.

    Regards,

    Greg M

  8. #8
    Forum Contributor
    Join Date
    12-06-2020
    Location
    Adelaide
    MS-Off Ver
    MS Office 365
    Posts
    108

    Re: Run-Time Error 13 - Type Mismatched when calling sub

    Thanks for the help. The code is working now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Stock Data Type: Error Type mismatched
    By VAer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2021, 06:41 PM
  2. Replies: 0
    Last Post: 04-10-2021, 04:18 AM
  3. [SOLVED] type mismatched error 13 on general text ???
    By incobart in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-02-2018, 01:14 PM
  4. [SOLVED] Calling SQL Stored Proc Using ADO (Run Time Error 3704)
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2015, 01:53 AM
  5. [SOLVED] When looping through Workbooks calling Macro - Run-time error '9': Subscript out of range
    By trizzo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2015, 07:17 AM
  6. [SOLVED] wheres my type mismatched??
    By bdrilling33 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-10-2014, 08:30 AM
  7. [SOLVED] Error when calling two similar subroutines at the same time
    By rawcode in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2013, 07:24 AM

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