+ Reply to Thread
Results 1 to 13 of 13

help with on error resume next

  1. #1
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    help with on error resume next

    Hi - can someone help me please. I have a number of columns that I wish to find in a spreadsheet so I repear the following on error resume next. But after it test's the cells.find it still copies the info and pastes it when I want it to ignore and to go to next test. Is there an easy way of doing this?

    Many thanks


    Please Login or Register  to view this content.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,979

    Re: help with on error resume next

    You don't really need an error handler with find if you assign it to a range variable.
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: help with on error resume next

    It displays an error at this point - (run time error - 13, type mismatch)

    Please Login or Register  to view this content.
    So I have changed to
    Please Login or Register  to view this content.
    but still another error

    run time error 424

    at the point of
    Please Login or Register  to view this content.
    Last edited by romperstomper; 11-29-2011 at 05:02 AM. Reason: remove unnecessary quote

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: help with on error resume next

    hi romperstomper, is it a typo or sort of educational trick?

    Please Login or Register  to view this content.
    instead of

    Please Login or Register  to view this content.

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,979

    Re: help with on error resume next

    Both were typos (the dangers of untested code):
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: help with on error resume next

    hi leanne2011,

    it should be:

    Please Login or Register  to view this content.
    plus see post #4

  7. #7
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: help with on error resume next

    Ok this is perfect - thank you. Just one problem though, in the first column it is going to the last row of data and copying and pasting but when it goes to the varFindItems its one row sort in the copy and paste function ?

  8. #8
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: help with on error resume next

    not sure if i was clear - the first time the procedure is run and in the 1st varfinditem, the copy and paste is the exact rows ie activerows but when it reruns the procedure 2nd time and onwards its 1 row short in copying the data across.

  9. #9
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,979

    Re: help with on error resume next

    Be easier to say why with a sample workbook and all of your code.

  10. #10
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: help with on error resume next

    Quote Originally Posted by romperstomper View Post
    Be easier to say why with a sample workbook and all of your code.

    Thanks for your help on this

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

  11. #11
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: help with on error resume next

    can anyone please help me with this

  12. #12
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,979

    Re: help with on error resume next

    I'm afraid I am quite busy at the moment, but I will try and take a look at lunchtime if no-one steps in before then.

  13. #13
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,979

    Re: help with on error resume next

    Can you give me a specific example as to what is missing on subsequent runs?

+ 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