+ Reply to Thread
Results 1 to 5 of 5

If duplicate is found in column B, delete Row, if not, msgbox and exit

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    If duplicate is found in column B, delete Row, if not, msgbox and exit

    I can search column B and delete the row if a duplicate has been found, but I can't figure out how to show a message box and exit the procedure if a duplicate isn't found. Can someone offer a little help?
    Please Login or Register  to view this content.
    How can I adjust this to exit sub and show a different message box if a duplicate isn't found in column B?

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: If duplicate is found in column B, delete Row, if not, msgbox and exit

    You could check the last row after the For Next and if the same then exit the sub...

    Something like...

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Re: If duplicate is found in column B, delete Row, if not, msgbox and exit

    ...i'll be back
    Last edited by VBA FTW; 02-18-2013 at 10:36 AM.

  4. #4
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Re: If duplicate is found in column B, delete Row, if not, msgbox and exit

    Thank you for your help Jeff, I think I have this sorted out. Many thanks

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: If duplicate is found in column B, delete Row, if not, msgbox and exit

    You're welcome…glad you have a workable solution and thanks for the feedback...

+ 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