bring data from sheet to another based on cell value

  • hello guys

    I hope some body help to write macro the idea is when I write in cell value "e5" in sheet " invoice" based on cell value in column b in sheet "data then bring all of data in cells value in G5 & E8 and the rests of data from row 16 in sheet" invoice" I put the expected result in sheet "invoice"

    this my try to write macro may be see this is not logic honestly I 'm beginner in vba but I try learning how write the code

  • Hello,


    As an initial step, you could test following :


    Hope this will help

    :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • thanks carim , but this doesn't work at all and no error also my code I thought may be disabled worksheet change event , I enabled by this code this Application.EnableEvents = True but doesn't work , any suggestion ,please?

  • may you complete your work , please ? how about data show from row 16 in sheet invoice as in my result and I would see the whole code and I check it with you to understand how works

    thanks again

  • thanks carim , but this doesn't work at all and no error also my code I thought may be disabled worksheet change event , I enabled by this code this Application.EnableEvents = True but doesn't work , any suggestion ,please?

    Do we agree the core event macro works ...???

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • yes , we agree now the macro works but if you mean this is my question absolutely no you can check my post#1 what I try and from the beginning I put the result in sheet invoice if this is not clear I'm ready to explain more but you don't ask me

  • Now that the core event macro operates fine ...


    You do have two possibilities :


    1. Fill in the Invoice details with the formulas to retrieve all the details based on the input cell E5

    or

    2. With VBA, learn to filter data and copy it back to the Invoice sheet


    Hope this will help

    :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Macro approach:

    Delete all the formulae in columns B to G. Place this macro in the worksheet code module. Enter an Invoice number in E5 and press the RETURN key or TAB key.

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Try the attached file. It's working properly for me.

    Files

    • INV1.xlsm

      (35.96 kB, downloaded 11 times, last: )

    You can say "THANK YOU" for help received by clicking the :thumbup: icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.