+ Reply to Thread
Results 1 to 6 of 6

find match in remainder of column

  1. #1
    Registered User
    Join Date
    03-29-2017
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    60

    find match in remainder of column

    Anyone want to take a shot at why I'm getting an "run-time error 1004 application definedd or object defined error at the beginning of my do until loop? I don't know if I'm right but I'm suspecting it may throw the error when it does not find a match?

    Just assume CSNcol has a list of a few hundred numbers, and some have matches and some do not.

    HTML Code: 

  2. #2
    Registered User
    Join Date
    03-29-2017
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    60

    Re: find match in remainder of column

    I think I got it figured out with a For loop, but I'm open to other suggestions where it only replaces the row ONLY IF it finds 1 other match.

    HTML Code: 

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: find match in remainder of column

    Please Login or Register  to view this content.
    If there is no match, your Do-Loop will loop until j is more than the max rows on your sheet and you will get that error. Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: find match in remainder of column

    You may want to use the .Find method instead of nested loops. You will notice a speed improvement.

    Find method

  5. #5
    Registered User
    Join Date
    03-29-2017
    Location
    Florida
    MS-Off Ver
    2010
    Posts
    60

    Re: find match in remainder of column

    Thanks AF. That page looks extremely helpful right now. I'm going to give it a shot on a copy of this sheet I'm working right now.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: find match in remainder of column

    Quote Originally Posted by billyjo182 View Post
    Thanks AF. That page looks extremely helpful right now. I'm going to give it a shot on a copy of this sheet I'm working right now.
    You're welcome. If you do a search for something like VBA Find Method, you'll find many other useful guides and tutorials.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Subtract from one column first, then another if remainder
    By haylleyjo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2018, 02:25 AM
  2. Countifs - Start of Number & Wildcard to find remainder
    By lookingforhelp1 in forum Excel General
    Replies: 2
    Last Post: 10-26-2015, 08:48 AM
  3. Replies: 6
    Last Post: 09-03-2015, 09:51 PM
  4. Replies: 4
    Last Post: 12-29-2013, 08:49 PM
  5. Macro to subtract from one column first, then another if remainder
    By neilo1969 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-20-2011, 05:33 AM
  6. Replies: 2
    Last Post: 11-15-2006, 11:04 PM
  7. [SOLVED] Taking a remainder amount from a column and adding it another colu
    By Help for Jason in forum Excel General
    Replies: 1
    Last Post: 08-02-2006, 01:56 PM

Tags for this Thread

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