+ Reply to Thread
Results 1 to 18 of 18

Concatenate, Delete Blank Rows & Remove Repeated Header

  1. #1
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    521

    Concatenate, Delete Blank Rows & Remove Repeated Header

    Hi,

    I have have worksheet on which data is pasted on daily basis. There are some data which appears on two cell. What I need

    Concatenate those cells which in two rows (Column E, F & M)
    Delete all the blank rows
    Delete repeated Header Rows (Except Row One)

    Al these process should be done on sheet Expected Result (Keeping the Original Data as it is)
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Concatenate, Delete Blank Rows & Remove Repeated Header


    Hi,

    the original formatting (colors) must be conserved ?

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    This macro will be very fast, even on huge sets of data. It expects your two sheets to be named as shown, so you can edit the macro to change the sheet names if needed.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JBeaucaire; 05-19-2020 at 12:21 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    521

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    Hi Marc,

    No need colors to be conserved, It is just for information only.

  5. #5
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    536

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    Test my code.
    Please Login or Register  to view this content.
    Best Regards,
    Maras.

  6. #6
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    521

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    @JBeaucaire

    Thanks, It is so fast and accurate. Please one more request, could you please delete entire row if there is duplicate order numbers.

    And If I delete the whole data in Result sheet and run the macro the date format is in General. Can you please format to date and time.

  7. #7
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    521

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    @maras_mak

    Thanks, Nice solution. Please one more request, could you please delete entire row if there is duplicate order numbers.

    And If I delete the whole data in Result sheet and run the macro the date format is in General. Can you please format to date and time.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    Try
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    521

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    Hi Jindon, Thanks but still duplicate Order number need to be deleted.

  10. #10
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    (removed, see both next posts)
    Last edited by Marc L; 05-19-2020 at 01:34 PM.

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    Order Number?
    Which column?

  12. #12
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Concatenate, Delete Blank Rows & Remove Repeated Header


    As your expected result does not match what you expect for, so where is your order # ?

  13. #13
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    521

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    Sorry ID (Column A)

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    You don't have duplicate, anyway...
    Add one line
    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    521

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    Thanks for all those for the wonderful code, anyway I have managed to remove the duplicate ID numbers with below code.

    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    521

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    Thanks Jindon, you are always genius. It is solved.

  17. #17
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this demonstration !


    According to your attachment as a VBA beginner starter without any variable neither any loop
    just using Excel basics - advanced filters & formulas - maybe not the fastest but fast enough :

    PHP Code: 
    Sub Demo1()
             
    Application.ScreenUpdating False
        With Sheet1
    .UsedRange
            
    .Range("V2").Formula "=ISNUMBER(A2)"
            
    .AdvancedFilter xlFilterCopy, .Range("V1:V2"), Sheet2.[A1:S1]
            .
    Range("E1:F1,M1").Copy Sheet2.[X1]
            .
    Range("V2").Formula "=ISBLANK(A2)"
            
    .AdvancedFilter xlFilterCopy, .Range("V1:V2"), Sheet2.[X1:Z1]
            .
    Range("V2").Clear
        End With
        With Sheet2
    .[A1].CurrentRegion.Rows
            With 
    .Item("2:" & .Count).Columns
                 
    .Item(5).Value2 = .Parent.Evaluate(.Item(5).Address "&"" ""&" & .Item(24).Address)
                 .
    Item(6).Value2 = .Parent.Evaluate(.Item(6).Address "&"" ""&" & .Item(25).Address)
                 .
    Item(13).Value2 = .Parent.Evaluate(.Item(13).Address "+" & .Item(26).Address)
                 .
    Item(13).NumberFormatLocal Sheet1.[M2].NumberFormatLocal " " Sheet1.[M3].NumberFormatLocal " "
            
    End With
                 
    .Columns("X:Z").Clear
                 
    .RemoveDuplicates Array(1), xlYes
        End With
             Application
    .ScreenUpdating True
    End Sub 
    ► Do you like it ? ► ► So thanks to click on bottom left star icon « Add Reputation » ! ◄ ◄

  18. #18
    Forum Contributor
    Join Date
    11-12-2012
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    2010, 2013, 2016, Office 365
    Posts
    521

    Re: Concatenate, Delete Blank Rows & Remove Repeated Header

    @Marc

    Thanks, Excellent.

+ 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. Delete Unnecessary Data and Remove Blank Rows
    By kingsdime29x in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2017, 02:26 AM
  2. [SOLVED] Concatenate If Blank - remove blank line if first cell is blank
    By ker9 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-27-2014, 02:14 PM
  3. [SOLVED] Delete the Rows If it is Blank cell below Table header "Status"
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2012, 05:55 AM
  4. how to remove the blank column (delete rows)
    By SelinaT in forum Excel General
    Replies: 1
    Last Post: 04-18-2011, 03:50 AM
  5. Remove repeated rows.
    By Hugo555 in forum Excel General
    Replies: 1
    Last Post: 05-07-2009, 03:09 AM
  6. Macro to remove the blank rows and detect header
    By coolanks1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-20-2009, 03:40 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