+ Reply to Thread
Results 1 to 8 of 8

Filling data from Sheet1 to Sheet2 with two or more conditions.

  1. #1
    Registered User
    Join Date
    02-02-2018
    Location
    TURKEY
    MS-Off Ver
    2013
    Posts
    40

    Post Filling data from Sheet1 to Sheet2 with two or more conditions.

    Greeting,
    First of all, thank you very much for such a site and it has been so helpful for me.

    Problem: so I'm doing an almost daily task which I couldn't do it by macros, I'll explain it by an example;

    For example, let's say that here I have the following table in Sheet1:
    Order No Color S M L XL XXL 2XL S-M L-XL STANDART
    S11G1371 BLAZE 10 20 20 20 10
    S11G1299 GREEN 5 10 10 10 5
    S11G1299 SOMON 5 10 10 10 5
    S11G1205 DARK GREY 5 9 9 9 5
    S11G1204 NAVY 6 12 12 12 6
    S11G1206 ECRU 5 8 8 8 4
    S11G1310 GREY 4 7 7 7 4

    almost every day I have to fill the amounts under columns S M L XL...etc. to a similar table as the following in Sheet2:

    Order No Color S M L XL XXL 2XL S-M L-XL STANDART
    S11G1275 YELLOW
    S11G1287 PURPLE 2 4 4 4 2
    S11G1298 BLUE 2 2 2 2 1
    S11G1298 YELLOW 1 2 2 2 1
    S11G1299 GREEN
    S11G1299 SOMON
    S11G1301 ECRU
    S11G1302 CREAM

    Now usually I use the FIND tool typing, for example, the "Order No" for example "S11G1299" in the Sheet2: and look at the color, let's say "GREEN" and copying the data under S M L XL...etc. from the table in Sheet1 to the same table in Sheet2, and do it over and over again for different Orders and note that the orders in Sheet2 can't resort for different reasons and the orders in Sheet1 have a different sorting system, my question is there any way or VBA code to do such a job? I mean going from Row1 or 2 and making data entry order by order?

    I hope you understood me,

    Thank you very much already for your help.

    Regards.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    51,366

    Re: Filling data from Sheet1 to Sheet2 with two or more conditions.

    Hi, welcome to the forum

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    02-02-2018
    Location
    TURKEY
    MS-Off Ver
    2013
    Posts
    40

    Re: Filling data from Sheet1 to Sheet2 with two or more conditions.

    Thanks for your reply,

    File attached.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-19-2019
    Location
    London
    MS-Off Ver
    2003-2016/2016 Mac
    Posts
    57

    Re: Filling data from Sheet1 to Sheet2 with two or more conditions.

    Use the below formula in Sheet 2 C4 and Drag across

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-02-2018
    Location
    TURKEY
    MS-Off Ver
    2013
    Posts
    40

    Re: Filling data from Sheet1 to Sheet2 with two or more conditions.

    Dear Saqib Qureshi;

    I don't know what to say to Thank you!

    Your formula perfectly worked (I didn't understand how it did though ) if you kindly explain what you did there I would be even more grateful.

    Thank you very much.

  6. #6
    Registered User
    Join Date
    03-19-2019
    Location
    London
    MS-Off Ver
    2003-2016/2016 Mac
    Posts
    57

    Re: Filling data from Sheet1 to Sheet2 with two or more conditions.

    Thankyou!.

    I checked for two conditions in array formula SUMPRODUCT.
    Please Login or Register  to view this content.
    checks if Order# is matching and
    Please Login or Register  to view this content.
    checks if Color is matching and return the number. I have assumed that you will always have Size columns arranged in the order given.

    If I helped you, add a reputation.

  7. #7
    Registered User
    Join Date
    03-19-2019
    Location
    London
    MS-Off Ver
    2003-2016/2016 Mac
    Posts
    57

    Re: Filling data from Sheet1 to Sheet2 with two or more conditions.

    Alternatively you can use this formula

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-02-2018
    Location
    TURKEY
    MS-Off Ver
    2013
    Posts
    40

    Re: Filling data from Sheet1 to Sheet2 with two or more conditions.

    Thanks for the explanation, actually you did help me and I added a Reputation.

    Regards.

+ 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] copy data from sheet1 to sheet2 based on column (A) sheet1 and column (C) sheet2
    By AWITCHER in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-13-2014, 03:20 PM
  2. Macro to copy the data from sheet1 and to paste it in sheet2 with conditions.
    By Thinker8 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2014, 09:55 AM
  3. Compare and copy new rows from Sheet2 to Sheet1 if conditions are met
    By author1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-25-2014, 02:07 PM
  4. Replies: 6
    Last Post: 07-25-2013, 02:58 PM
  5. [SOLVED] Proper Syntax for filling out a template on Sheet2 based upon a row number from Sheet1
    By bmiller29 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2013, 09:50 AM
  6. How to copy Specefic data from Sheet1 to Sheet2 if conditions met.
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2013, 03:44 PM
  7. [SOLVED] Create Special format by copying data from Sheet1 to Sheet2 with conditions using VBA
    By Narasimharao Nandula in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2013, 01:12 AM

Tags for this Thread

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