+ Reply to Thread
Results 1 to 7 of 7

Runtime Error 13 -Type mismatch error

  1. #1
    Registered User
    Join Date
    12-27-2012
    Location
    Kingston, Jamaica
    MS-Off Ver
    Excel 2007
    Posts
    30

    Runtime Error 13 -Type mismatch error

    Hi,
    I have added a button that is suppose to select the data from another file and copy and paste in the selected month on the userform, but I am getting the error listed in the title "Runtime Error - Type mismatch error. I don't know if the that how to correct this error. It errors out at the area highlighted in red, this is where I name each sheet. I would type the name in B1 and the sheetname will change. The move sheet code I'll also include this work up to the point where the data must be paste on the new sheet base on the selection, then it won't paste and I receive the error. My deadline is by Thursday and I must test this week, please help


    Nika

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Runtime Error 13 -Type mismatch error

    What's in B1 of the active sheet when you get the error?

    Also, what is that code meant to do?

    Are you trying to compare what's in B1 with Target or are you trying to see if B1 is target?

    By the way, is this code connected to the userform?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-27-2012
    Location
    Kingston, Jamaica
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Runtime Error 13 -Type mismatch error

    Hi
    B1 has the actual name of the sheet. The code names the sheet once it is typed in B1 in the active sheet. I have changed and is now trying to use userform where you would select the month and then it would perform the request. My problem is that when it is to go to the selected month I am getting the error. If I try to link it to the selection from the userform by using this line of code "' If Target = Worksheets(frmFindLoanInfo.cmbMnthClaim.Value) Then", then I get Runtime error 9 subscript out of range. I thought I should have connected it to the form.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Runtime Error 13 -Type mismatch error

    What exactly are you trying to do?

    Target is the range that's been changed on worsheet Sh.

    You can't compare it to a worksheet as this is doing.
    Please Login or Register  to view this content.
    Also, unless frmFindLoanInfo.cmbMnthClaim.Value returns the name of a worksheet you'll get a subscript out of range error.

  5. #5
    Registered User
    Join Date
    12-27-2012
    Location
    Kingston, Jamaica
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Runtime Error 13 -Type mismatch error

    I don't know how to get past this hurdle, what am I suppose to do. I am going to include the section where the frmFindLoanInfo.cmbMnthClaim.Value is dealt with. Because once I try the copy process I am getting that message. I try to attach the file but it is too large. I have remove so of the buttons and included the Move Sheet function which is where the error is and zip and uploaded. Please have a look and see if you can help. Thanks

    Nika
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Runtime Error 13 -Type mismatch error

    Nika

    I though the problem was in the code you posted in your first post?

  7. #7
    Registered User
    Join Date
    12-27-2012
    Location
    Kingston, Jamaica
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Runtime Error 13 -Type mismatch error

    I am not sure what I am doing that is wrong I want to be able to paste in the selected sheet after clicking on it in the userform. I do receive the error in what was posted before but I don't know what should be the fix, that is why I included the code for the form to see if that would shed some light. Sorry for the confusion.

+ 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