+ Reply to Thread
Results 1 to 14 of 14

Combine data of 2 sheets to one sheet with one condition

  1. #1
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Combine data of 2 sheets to one sheet with one condition

    Hello experts
    I want to combine the data of 2 sheets which are in another folder and get the result in the source workbook where the button is situated in the 2B Combined sheet. There are multiple folders in the source folder where the data is to be derived. There is a condition to be added in the code. The data of B2B sheet to be copied as it is and the data of B2B - CDNR to be posted in the required columns with negative amounts. The code in the workbook was shared by Marc L which had multiple conditions but in this project This is for reference purpose only. I need to apply only the above condition. I need all the rows in both the sheets. Rest is explained in the steps sheet.
    Thank you in Advance
    The 2 sample xlsx sheets are saved in a folder named 2B Folders and saved on the desktop.
    Last edited by RAJESH SHAH; 10-05-2023 at 04:51 PM. Reason: #Solved by John Topley
    "There is nothing called problem, it's just absence of an idea to find*solution."
    ?I have not failed. I?ve just found 10,000 ways that won?t work.?
    ?Thomas Edison

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Combine data of 2 sheets to one sheet with one condition

    See attached: B2B Combined
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Combine data of 2 sheets to one sheet with one condition

    Thanks John Topley. Just one column to correct in the destination sheet. Column I Rate is the percentage of tax and not amount. I want the value of that cell to be positive in the result.(Derived from B2B - CDNR sheet in negative values). You can tell me which line to edit. Sorry I also want to remove the lines printing W and X completely.
    Last edited by RAJESH SHAH; 10-04-2023 at 04:16 PM.

  4. #4
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Combine data of 2 sheets to one sheet with one condition

    Please Login or Register  to view this content.
    How do I edit this to avoid changing column I to negative.?

  5. #5
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Combine data of 2 sheets to one sheet with one condition

    I was able to solve the column W and X by commenting these 2 lines. But to avoid the Rate column values from changing to negative is a little tough.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Combine data of 2 sheets to one sheet with one condition

    I simple changed the filter constant in Marc's code to be a "wildcard" so that as far as I will go!

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Combine data of 2 sheets to one sheet with one condition

    Comment out ...

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Combine data of 2 sheets to one sheet with one condition

    Still I am not able to avoid the Rate % column from converting to negative.
    Will try again tomorrow. Thanks John Topley. Good Night.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Combine data of 2 sheets to one sheet with one condition

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

  10. #10
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Combine data of 2 sheets to one sheet with one condition

    That is the same line in the code. It is showing negative values in Rate column whereas I want it to show positive.
    Last edited by RAJESH SHAH; 10-05-2023 at 05:10 AM.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Combine data of 2 sheets to one sheet with one condition

    Not if you make it a COMMENT!

  12. #12
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Combine data of 2 sheets to one sheet with one condition

    If I comment it only the column 6 is showing negative figures. I need negative figures in columns 10 to 14 too. I think I better go with that line as it is showing only one negative figure in the Rate% column untill these lines are corrected and resolved.
    Please Login or Register  to view this content.

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Combine data of 2 sheets to one sheet with one condition

    try
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,147

    Re: Combine data of 2 sheets to one sheet with one condition

    The edited code in post#13 worked perfectly. Thank you John Topley

+ 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] Combine data of multiple sheets to one with a code - add one condition
    By RAJESH SHAH in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-15-2023, 01:14 PM
  2. [SOLVED] Code to combine data of 2 sheets with condition
    By RAJESH SHAH in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-04-2023, 02:49 PM
  3. How to combine data of sheets in one workbook based to multiple IF condition
    By mami502003 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-20-2021, 10:01 AM
  4. Combine data in different sheets into one sheet
    By wew044 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-05-2019, 03:26 AM
  5. Combine data in multiple sheets to one sheet
    By RDevi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2016, 10:44 AM
  6. Replies: 0
    Last Post: 10-12-2015, 10:02 AM
  7. How do you combine data from 5 sheets to 1 sheet?
    By geng in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-09-2010, 08:33 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