+ Reply to Thread
Results 1 to 8 of 8

Delete empty rows and duplicate entries

  1. #1
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Delete empty rows and duplicate entries

    Need help as follows. thanks much

    Running down row by row,
    If column D is a blank, then the corrosponding row is to be deleted. This is to be done until the whole spreadsheet is completed.
    (refer to the attached, if this is done correctly, then row 4 to 10 is to be deleted)

    Then column B is to be filled up with the corrosponding value aboue it.
    (refer to the attached, if this is done correctly, then B3 and B4 are filled with 6031)
    Attached Files Attached Files

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Delete empty rows and duplicate entries

    Try running this macro.

    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  3. #3
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Delete empty rows and duplicate entries

    Thanks much!

    The first problem is solved.
    As to the 2nd requirement - "column B is to be filled up with the corrosponding value aboue it". it duplicates the very first value at column B.

    Pls see attached. Cell B5, B6 should be 6002 and Cell B8 should be 6003.
    Attached Files Attached Files

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Delete empty rows and duplicate entries

    Sorry for the mistake, try this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Delete empty rows and duplicate entries

    Thanks much for the help. you are awesome.

    Can help with a additional requirement?
    I created a button for the macro. It overwrites the current data when I run it. How to show the results in another new worksheet while retaining the orginal data in its orginal worksheet?



    Quote Originally Posted by millz View Post
    Sorry for the mistake, try this:

    Please Login or Register  to view this content.

  6. #6
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Delete empty rows and duplicate entries

    You can record a macro as such:

    1. Right click on worksheet name, Move or Copy...
    2. Click (move to end), check Create a copy
    3. Stop recording

    With the recorded code, put it above the code that I have provided, then it should be working as you want it.

  7. #7
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Delete empty rows and duplicate entries

    thanks Millz.

    It just got a little bit more challanging.
    Other than the blank spaces to get rid of, now there are also extra header fields to remove.

    Please see attached.
    How to modify the earlier macro code to delete the "header fields", ie row 12 and 24. thanks much again
    Attached Files Attached Files

  8. #8
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Delete empty rows and duplicate entries

    You can try it like this:

    Please Login or Register  to view this content.

+ 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. [SOLVED] Delete duplicate rows containing the oldest date and time entries
    By 180drop in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-25-2014, 05:48 AM
  2. [SOLVED] Stocklist - Combine Duplicate entries, Delete rows
    By ibs2012 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2013, 05:56 AM
  3. delete duplicate rows, delete empty rows
    By loade in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-03-2012, 05:42 AM
  4. Replies: 2
    Last Post: 08-24-2011, 05:42 PM
  5. [SOLVED] I want to delete rows with duplicate entries within one column.
    By kini olegario in forum Excel General
    Replies: 1
    Last Post: 01-14-2005, 10:07 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