+ Reply to Thread
Results 1 to 13 of 13

Macro to combine Qty and Price Columns separated by Total Columns

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

    Macro to combine Qty and Price Columns separated by Total Columns

    Great help from this Group always

    Regards
    Attached Files Attached Files
    Last edited by prkhan56; 08-17-2017 at 02:47 AM. Reason: Solved

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    11,672

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Hi prkhan56

    FYI ...When running my code on your uploaded sample
    Lrow gave a value of 294...I deleted rows 14-295 on Before sheet
    nRow gave a value of 283... I deleted rows 2-284 on After Sheet
    Try this....
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 08-16-2017 at 09:48 AM. Reason: Changed code ----Added App.ScreenUpdating
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

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

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Hello Sintek,
    Marvelous code!!

    Some small tweaks if you could do it for me please it would really appreciated

    1) ID shown in the sample is running numbers for sample only. Actual data it is an Alpha Numeric values. Is it possible to get the right 10 characters of the ID. Similar to =Right(a4,10)

    2) I had given Cust1, Cust2 etc for explanation. Is it possible to get the actual values same as for the Description1, Description2 etc..

    3) As mentioned in my original post, the macro should create the new sheet After and then paste the date in that sheet

    Hope to get your valuable support

    Thanks

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

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Hello Sintek,
    I thing I missed in the previous post.

    You have posted test1 and test2...I think both are same.
    Or are they different?

    Thanks once again.

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

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Please Login or Register  to view this content.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    11,672

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    the uploaded samples have different scenarios...My code works for 2 or more Customers....

    Herewith amended...Not sure what you mean by
    I had given Cust1, Cust2 etc for explanation. Is it possible to get the actual values same as for the Description1, Description2 etc.

    Please Login or Register  to view this content.
    Edit...
    Perhaps uploading a sample depicting your actual scenario might assist...
    Last edited by sintek; 08-16-2017 at 01:46 PM.

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

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Dear Sintek
    Thanks once again
    Please see the comments in color

    1) ID shown in the sample is running numbers for sample only. Actual data it is an Alpha Numeric values. Is it possible to get the right 10 characters of the ID. Similar to =Right(a4,10)
    I want the right 10 characters of the ID

    2) I had given Cust1, Cust2 etc for explanation. Is it possible to get the actual values same as for the Description1, Description2 etc..

    Yes you are right my mistake in explaining. But you had used Cust* as the criteria. I think the Columns from C3 to the count of first Total in Row3 and then from the next column on the right side of the Total should be the criteria

    My Cust Names are Alpha Numeric values
    eg:
    Cust1 Cust2 Cust3 Cust4 Cust5 Cust6 Cust7
    12345 DFC 23456 AL WM 345 F C R B 1180 D M AE 667 MCC 111 YM AE 999 M CAE



    3) As mentioned in my original post, the macro should create the new sheet After and then paste the date in that sheet - Thanks this is perfect now

    Thanks once again for your prompt response to my problem

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

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Hello Jindon,
    Thanks for your code
    Your code works for the sample I have provided but the OP says that the Cust will increase from 1 to N

    The criteria is Total shown in Row 3 is Important

    To the left of the first Total is the Qty and to the right of Total is Price

    Your code works for 6 Columns i.e. 2 Cust + Total and 2 Cust + Price

    Regards

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

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Hello Sintek
    While uploading the Cust Nos messed up
    So I am attaching an excel file for clear understanding of the Customer Names

    Regards
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    20,784

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Quote Originally Posted by prkhan56 View Post
    Hello Jindon,
    Thanks for your code
    Your code works for the sample I have provided but the OP says that the Cust will increase from 1 to N
    Where did you?

    Please Login or Register  to view this content.

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

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Hello Jindon,
    Sorry, it was mentioned on the sample data 'Before' Sheet not in OP
    Sorry once again.

    Hope you now understand my requirement

    Thanks

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    11,672

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    My amended...Although jindon's solution is far more superior.
    Please Login or Register  to view this content.
    Last edited by sintek; 08-17-2017 at 02:07 AM.

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

    Re: Macro to combine Qty and Price Columns separated by Total Columns

    Thanks Sintek,
    Great help.
    Post Marked SOLVED

    PS: Jindon thanks to you also

+ 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] Populate data in specific way (some for separated columns .. others in one columns)
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2016, 07:22 PM
  2. Replies: 10
    Last Post: 08-04-2014, 08:18 AM
  3. Error in a existing Macro used for compare the Comma Separated Values present in 2 columns
    By Manish_Gupta in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2014, 05:44 AM
  4. [SOLVED] Facing problem in a Macro which compares 2 columns having comma separated / single values
    By Manish_Gupta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2014, 11:18 PM
  5. Macro to combine multiple columns keeping few columns specific
    By lramesh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2013, 12:44 PM
  6. MAcro to - copy, transpose, text to columns, remove column A, combine all columns in 1
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 02-07-2013, 08:48 AM
  7. CSV file with two columns multiple values separated by pipe. Need to Combine
    By nikythebest in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-01-2012, 04:30 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