+ Reply to Thread
Results 1 to 7 of 7

Solving a "run time error"

  1. #1
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Solving a "run time error"

    am looking for help on this macro. I keep getting "run time error 13" (error 2015). With the following line:

    Please Login or Register  to view this content.
    The macro basically inserts a formula in cell "R2" then if the value is less than or equal to 10 it will copy and paste the row.
    If I plug in another cell other than R2 than it copies every row and does not filter out the values that are more than 10.

    Does anyone know what I am doing wrong? I have attached the excel file.

    Thanks
    Attached Files Attached Files
    Last edited by glide2131; 05-22-2013 at 02:34 PM.

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

    Re: Solving a "run time error"

    You don't have a function called GetMiles, so the formula in R2 returns #NAME!.
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Solving a "run time error"

    this:
    Please Login or Register  to view this content.
    is producing an error into Cell R2, when you try to compare an error with a number you'll a get a type mismatch.

    you can check the value first like this:
    Please Login or Register  to view this content.
    apart from that, where is the function 'GetMiles' ??
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  4. #4
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Re: Solving a "run time error"

    Thanks for your reply, here is the function:

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Solving a "run time error"

    Check the 2nd row in sheet 'Comps', should be a value, not a heading?!

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

    Re: Solving a "run time error"

    When I put that function in a module the error changes to #VALUE!.

    By the way, the only way I could get the code to run was to add some blank sheets.

    It doesn't get past this otherwise.
    Please Login or Register  to view this content.
    As well as the code for GetMiles are there sheets missing?

  7. #7
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Re: Solving a "run time error"

    That did it!. Thanks

+ 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