+ Reply to Thread
Results 1 to 9 of 9

Delete rows based on the list of unique identifiers created

  1. #1
    Registered User
    Join Date
    08-13-2016
    Location
    india
    MS-Off Ver
    2010
    Posts
    61

    Delete rows based on the list of unique identifiers created

    Hello forum,

    Hope you guys are having good time there!

    I have a workbook with data up to 10000 rows, all we need is to create a list of unique identifier and VBA codes that can delete the rows that contains the unique identifier in it.

    Below unique identifier list -
    Madilu
    Bg pura
    Nandhi

    So for example in cell b7 there might be the word nandhi: when macro is run row 7 should be deleted. Similarly cell c 9 might contain word madilu so when macro is run row 9 should be deleted!
    Unique identifier should be matched in both column b and column c of the sheet and first run on column b and delete the found/matched and again run on column c deleted the mached rows with list above. If able to run on both the rows simultaneously then it is better.


    Note- if possible to include multiple conditions (in this example 3 from the above list) to run at one go it is better.
    Last edited by Andy308; 08-31-2016 at 10:51 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Delete rows based on the list of unique identifiers created

    Do you have a workbook I can test with?

  3. #3
    Registered User
    Join Date
    08-13-2016
    Location
    india
    MS-Off Ver
    2010
    Posts
    61

    Re: Delete rows based on the list of unique identifiers created

    Currently I am unable to access computer to send sample file. If it is needed then I will see and it tomorrow! Thanks for looking into Poizhan!

  4. #4
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Delete rows based on the list of unique identifiers created

    Ok, try this, I think this is what you are looking to do.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by 1aaaaaaaaaaaaaaa; 08-30-2016 at 05:39 PM.

  5. #5
    Registered User
    Join Date
    08-13-2016
    Location
    india
    MS-Off Ver
    2010
    Posts
    61

    Re: Delete rows based on the list of unique identifiers created

    I tried using this code, however Iam getting an error message as “Run – time error ‘91’, Object variable or with block variable not set” and code stops to run in line rng.Select . I guess this is because the cells in column A are merged. I have attached the sample file and updated the keywords. Please help on this issue to be fixed.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Delete rows based on the list of unique identifiers created

    Seems your data does not start on row 1, is this on purpose?

  7. #7
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373

    Re: Delete rows based on the list of unique identifiers created

    Modified code

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by 1aaaaaaaaaaaaaaa; 08-31-2016 at 10:40 AM.

  8. #8
    Registered User
    Join Date
    08-13-2016
    Location
    india
    MS-Off Ver
    2010
    Posts
    61

    Re: Delete rows based on the list of unique identifiers created

    Thanks Poizhan! It worked perfect now, let me mark the thread as closed.

  9. #9
    Valued Forum Contributor
    Join Date
    02-06-2014
    Location
    N/A
    MS-Off Ver
    N/A
    Posts
    373
    Quote Originally Posted by Andy308 View Post
    Thanks Poizhan! It worked perfect now, let me mark the thread as closed.
    You're welcome, God bless you my friend

+ 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. Replies: 11
    Last Post: 04-11-2015, 05:48 PM
  2. [SOLVED] Compare multiple rows with unique identifiers to return action
    By Scoobing in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-30-2014, 05:03 PM
  3. How to shift an array of data into columns based on unique identifiers...
    By PolishJoke in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-11-2014, 06:05 PM
  4. Sorting based on unique identifiers
    By excel_beginner2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2014, 10:09 AM
  5. [SOLVED] Delete rows of data based on list of unique numbers with a macro
    By rz6657 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2013, 07:40 AM
  6. Replies: 4
    Last Post: 03-09-2011, 12:16 PM
  7. Delete rows based on unique syntax
    By tzflorida in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-06-2009, 02:59 PM

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