bring data from sheet to another based on cell value

Important Notice


Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • 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 "Smiley" icon, 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 "Smiley" icon, 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 "Smiley" icon, below, in the bottom right corner :)

  • thanks

    I would that by vba not formula as you see I try by vba and I failed ,that's why I ask assistance to complete my project and see how the code works

    thanks

  • Since you are in a learning process ...


    In order to design a VBA solution to Filter and copy filtered rows back to your sheet ... take a look at following thread :


    copy rows with filter based on values in another sheet


    Hope this will help

    :)

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

  • It would appear that you have downloaded the proposal ...


    Feel free to share your comments ...

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

  • great work ! honestly I was expected doing that by vba , it doesn't seem easy , despite you did it by formula but it's very impressive thanks for your time and patience

  • Thanks for your Thanks ... AND for the Like :thumbup:

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, 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 "Like" 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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!