+ Reply to Thread
Results 1 to 2 of 2

code not working - remove repeated lines

  1. #1
    Registered User
    Join Date
    02-10-2013
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    15

    code not working - remove repeated lines

    The attached spreadsheet contains 17,754 rows and when the following macro is run over sheet("NOIM") it is reduced to 3,895 by a combination of removing rows from column "A" that contain the code 7618 and also by removing any other rows that re repeated as far as info kept in col"B" is concerned.

    Our problem is that rows 601 & 1465 ELECTROSURGICAL APPARATUS:* LIGASURE SMALL JAW;18.8cm;28deg;(COVIDIEN #LF1212)

    and

    2531 & 2552 KIT,HERNIA:* LAPAROSCOPIC;(TYCO #K6097);FOR MR CHEN

    remain behind. Technically only 601 and 2531 should remain. Can anyone provide a reason why the macro is NOT working across these two rows? Is it to do with the '*' wildcard?

    Is there a better way of running the part of the macro that leave only the unique entries? The data is presented int he spreadsheet below. I hope I havent ballsed it up this time and it actually posts!

    thanks you
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: code not working - remove repeated lines

    Excel 2010 has a simple to use REMOVE DUPLICATES option on the DATA tab.
    Please Login or Register  to view this content.

    Also, in your original macro, here's a way to remove all the 7681 rows without looping line by line:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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