+ Reply to Thread
Results 1 to 14 of 14

Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

  1. #1
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Hello All,
    I am using Excel 2013 and have a macro Button on Sheet1 which gives the output shown on ACTUAL sheet.
    There are two Tables viz Table2 and Table35 which are used in the Module

    I wish to change the macro to give me the output based on RN (Column D) as per shown in the DESIRED sheet

    Col L (INV) should be shown in separate columns INV2, INV3 .....etc (see the DESIRED sheet) (Cells colored for explanation purpose only)

    Any help would be very much appreciated to amend the current code

    TIA

    Rashid Khan
    Last edited by prkhan56; 02-28-2017 at 06:38 AM. Reason: Solved

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Hi,

    I am terrible with macro's, so I would like to provide an alternate solution to your situation.
    Plus I think you should keep the "Actual" so if you need to do a search using the inventory number it will be easier in the future.

    My solution involves having your "Desired" as an additional sheet instead of replacing your "Actual".

    The new sheet will consist of a Pivot Table to consolidate most of your table. With a formula to the right to return your inventory data.

    The fundamentals of this formula can be found here:

    http://www.globaliconnect.com/excel/...=77&Itemid=473

    Attached is a modified version of your file. The additional "Pivot & Formula" tab demonstrates how a Pivot and Formula can provide the "desired" results.

    Hope this makes sense and is helpful.

    Cheers

  3. #3
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Hi,
    Thanks for your time and solution.


    Your formula gives the following results

    Inv1 Inv2 Inv3 Inv4 Inv5
    198565 201653 206185 205926
    205673


    Actually it should be as below
    195085 198565 201653 206185
    205926 205673

    However, I would like to have a VBA Solution.

    Thanks once again.

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Hi,

    Sorry for the mistake in the formula. I got in a hurry. Here is the corrected one.

    Please Login or Register  to view this content.
    Good luck with a VBA Solution.

    Cheers

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

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    vba
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Hello Jindon,
    Thanks for your marvelous code as usual.

    A small problem is coming when I run it on my real data.
    The sample shown on the DESIRED sheet was having few Invoice Nos extending from Cell M5 onwards
    My actual data have many invoice numbers so now when I run the macro it is not extending further ..it stops at whatever heading is last in Row no. 4

    Is it possible to amend your code to extend from Cell M5 with heading Inv2, Cell N5 as Inv3, Cell O5 as Inv4....till the last invoice available.
    My current listing of Invoice Nos are 40+ in some cases which might be more in future too.

    Thanks once again for your time and help

  7. #7
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Thanks for your amended formula and link you gave me in your previous post.
    I would use in my future requirements

    Cheers

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

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Try change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Thanks Jindon.
    But the heading is coming as Column1, Column2...etc till the last Column
    Can the heading show as INV2 for Column1, INV3 for Column2 till the last

    Thanks once again for all your time and support.

  10. #10
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Hello Jindon,
    Any update on my problem please!

    Thanks for your time and help once again.

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

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    If you upload a workbook that shows your desired results, may be help to understand what you are trying to do.

  12. #12
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Hello Jindon,
    Please check the attached sample

    Sheet YOUR MACRO shows the result. Please see Cells M5 to P5. It displays Column1, Column2 etc

    Kindly see the sheet DESIRED. Cells M5 to P5. It should display INV2, INV3 etc...

    Your code is perfect

    The only issue is that instead of showing Column1, Column2 etc it should show INV2, INV3 ...

    Hope it is clear

    Thanks for all your help

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

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    OK, add one line
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    06-03-2004
    Location
    India
    MS-Off Ver
    2013
    Posts
    205

    Re: Macro to combine duplicate Rows Based on a particular Column to separate INV Headings

    Hello Jindon,
    Thanks thanks and thanks
    you are always a great help

    Post marked Solved

+ 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. Combine and transpose rows of data under column headings
    By dberglund in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2016, 10:43 AM
  2. Replies: 8
    Last Post: 11-25-2014, 05:11 PM
  3. Macro to duplicate rows based on value in A column
    By gemmasou81 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2014, 06:22 AM
  4. Combine rows with duplicate values into separate columns
    By itgeekgroup in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-18-2014, 11:12 AM
  5. How to combine data from multiple rows when common column headings exist?
    By pkoury in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-01-2013, 10:43 AM
  6. [SOLVED] Need a Macro that will duplicate rows a number of times based on a column value
    By Lassitude in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2013, 12:04 PM
  7. [SOLVED] How do i combine duplicate column headings
    By Mike in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-01-2006, 04:35 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