+ Reply to Thread
Results 1 to 4 of 4

Macro deleting all, not just the duplicates

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Macro deleting all, not just the duplicates

    Good afternoon all

    I have a workbook with several sheet... two of which are called 'Data' and 'Add Driver', both have headers.

    I'm looking at comparing the information in column B in both sheets,,, when it finds a duplicate I'm looking at deleting the row in the sheet 'Add Driver', the ranges, including headers, start in Row 8 on the 'Data sheet and Row 1 on the 'Add Driver Sheet'

    I have been working with this macro but the closest I can get it, is for it to delete everything, except the headers in the 'Add Driver' sheet

    Any help would be much appreciated

    Many thanks

    JT

    Please Login or Register  to view this content.
    Last edited by JamesT1; 04-29-2019 at 12:02 PM. Reason: Solved

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Macro deleting all, not just the duplicates

    Please Login or Register  to view this content.
    This statement says if you don't find a duplicate, then delete the row. I think if you change the (=) symbol to a (>) symbol it will do what you want.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    418

    Re: Macro deleting all, not just the duplicates

    JLGWhiz

    Now it works a treat,, many thanks for your help

    Much apprececiated

    JT

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Macro deleting all, not just the duplicates

    Quote Originally Posted by JamesT1 View Post
    JLGWhiz

    Now it works a treat,, many thanks for your help

    Much apprececiated

    JT
    You're welcome,
    regards, JLG

+ 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. Macro deleting duplicates between 2 sheets
    By mamachrissy1028 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2015, 04:50 PM
  2. [SOLVED] Macro For Deleting Duplicates, Comparing Rows and Retaining Minimum Value
    By banawaja in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-08-2014, 04:45 AM
  3. Macro Code - Deleting Duplicates based on same cell value and date comparison
    By Desree86 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-13-2014, 04:01 PM
  4. Replies: 0
    Last Post: 02-13-2013, 04:35 PM
  5. [SOLVED] Macro for finding duplicates then deleting the row
    By adamj1910 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2012, 04:11 AM
  6. Deleting Duplicates-find out a way to delete duplicates
    By sighlent1 in forum Excel General
    Replies: 2
    Last Post: 04-19-2011, 10:17 AM
  7. Deleting duplicates in a macro
    By tryaz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2009, 03:31 AM

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