+ Reply to Thread
Results 1 to 3 of 3

Type mis-match error

Hybrid View

  1. #1
    Marcotte A
    Guest

    Type mis-match error

    I have a macro that basically copies data from one worksheet to another
    (within the same workbook). Below are two lines of code. The first
    executes, but the second gives me a Run Time Error 13 - Type mismatch. I've
    formatted all relevant cells the same, and all my variables are singles.

    ReportSht.Cells(CurrRow, 4) = (MasterSht.Cells(i, 8) + _
    MasterSht.Cells(i, 9)) * ReportSht.Cells(5, 3)

    ReportSht.Cells(CurrRow, 6) = (MasterSht.Cells(i, 10) + _
    MasterSht.Cells(i, 11)) * ReportSht.Cells(5, 3)

  2. #2
    Tushar Mehta
    Guest

    Re: Type mis-match error

    In article <4D85FC2A-1CA6-4E55-A08F-A57F61C8C9CB@microsoft.com>,
    MarcotteA@discussions.microsoft.com says...
    > I have a macro that basically copies data from one worksheet to another
    > (within the same workbook). Below are two lines of code. The first
    > executes, but the second gives me a Run Time Error 13 - Type mismatch. I've
    > formatted all relevant cells the same, and all my variables are singles.
    >
    > ReportSht.Cells(CurrRow, 4) = (MasterSht.Cells(i, 8) + _
    > MasterSht.Cells(i, 9)) * ReportSht.Cells(5, 3)
    >
    > ReportSht.Cells(CurrRow, 6) = (MasterSht.Cells(i, 10) + _
    > MasterSht.Cells(i, 11)) * ReportSht.Cells(5, 3)
    >

    You have non-numeric data in MasterSht.Cells(i, 10) or ..., 11) Even
    if it only numbers in the cell, XL may be treating the cell as text.

    --
    Regards,

    Tushar Mehta
    www.tushar-mehta.com
    Excel, PowerPoint, and VBA add-ins, tutorials
    Custom MS Office productivity solutions

  3. #3
    Dave Peterson
    Guest

    Re: Type mis-match error

    Actually, all your values are Doubles -- since you're picking them up from the
    worksheet directly.

    I think I'd check each cell's value to see if it's numeric.

    My bet is that you have a non-numeric value in one of those cells.



    Marcotte A wrote:
    >
    > I have a macro that basically copies data from one worksheet to another
    > (within the same workbook). Below are two lines of code. The first
    > executes, but the second gives me a Run Time Error 13 - Type mismatch. I've
    > formatted all relevant cells the same, and all my variables are singles.
    >
    > ReportSht.Cells(CurrRow, 4) = (MasterSht.Cells(i, 8) + _
    > MasterSht.Cells(i, 9)) * ReportSht.Cells(5, 3)
    >
    > ReportSht.Cells(CurrRow, 6) = (MasterSht.Cells(i, 10) + _
    > MasterSht.Cells(i, 11)) * ReportSht.Cells(5, 3)


    --

    Dave Peterson

+ 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