+ Reply to Thread
Results 1 to 6 of 6

Runtime Error Type Mismatch

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    united states
    MS-Off Ver
    Excel 2003
    Posts
    19

    Runtime Error Type Mismatch

    For some reason this code works at home two test files, but when running at work I get this error. The macro loops through a list of sheet names in the macrobook and in the wb2 it should select all cells and copy paste as values, which doesn't happen because of this error. Then it deletes all sheets if the sheet name is not in the list in the macrobook. It does delete the sheets properly. Maybe the solution would be to add another code that loops through the remaining sheets and copy paste as values? Or does someone know what I'm doing wrong here.

    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,643

    Re: Runtime Error Type Mismatch

    Are there any errors in any of the cells in any of the worksheets?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    06-18-2012
    Location
    united states
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Runtime Error Type Mismatch

    Quote Originally Posted by Norie View Post
    Are there any errors in any of the cells in any of the worksheets?
    No errors in the cells of the worksheets. Also the code in asterisk is the part that I need to debu.

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

    Re: Runtime Error Type Mismatch

    I know which line is causing the problem.

    The only reason I can see that code causing the described problem is if a cell had an error in it.

    What is the line of code meant to be doing anyway?
    Last edited by Norie; 05-08-2013 at 08:45 PM.

  5. #5
    Registered User
    Join Date
    06-18-2012
    Location
    united states
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Runtime Error Type Mismatch

    I'm not sure as I had help with this code. I think it's checking to see if the value in the cell is blank, and if its not, then it takes out any spaces if the cell value starts with spaces? If it's difficult to pinpoint the issue, is there a way to modify this code to get it to work?

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

    Re: Runtime Error Type Mismatch

    I don't think the code is the problem, it's the data.

    This might work.
    Please Login or Register  to view this content.
    By the way, I'm not sure you need the If Trim(rngCell.Value) <> vbNullString part.

+ 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