+ Reply to Thread
Results 1 to 5 of 5

Help creating a macro to identify and delete specific rows.

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    3

    Help creating a macro to identify and delete specific rows.

    Hello, I have a spreadsheet that I would like to add a macro to to identify that if in column H there is an output that reads COF01, to find the obligation number in coulmn B in the same row. Then identify all other rows of data that have the same obligation number and delete them. I have attached a small example of the s/s, so the goal is that all rows that are highlighted purple would automatically be deleted out. If anyone could provide a marco or suggestions of how to creat one I would really appriciate it. Thank you!Example.xlsx

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Help creating a macro to identify and delete specific rows.

    Why would the white block of 0449 above the purple block of 0449 not be deleted if:
    Then identify all other rows of data that have the same obligation number and delete them.
    The following hides the rows for now, until we are sure it is right.
    Please Login or Register  to view this content.
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Registered User
    Join Date
    05-08-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Help creating a macro to identify and delete specific rows.

    Thanks for the reply, the white block of 0449 would not be deleted because it contains different obligation numbers in column B. I need the macro to identify the ids in column B and then delete all the rows that have the same id in column B.

  4. #4
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Help creating a macro to identify and delete specific rows.

    This will hide them for now. I'm erroring on deleting but need to run. I can revisit this evening.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-08-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Help creating a macro to identify and delete specific rows.

    Thank you that worked great! let me know if you update it to deleting the rows.

+ 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