Insert Rows as many as a Cell's Value

  • Dear experts,


    Need your help in this case.
    I have a table consisting of two columns, column one for "Item" and column two for "Qty"
    I need to create new table that is the result when one inserts new rows as many as "Qty" owned by the "Item".
    You can see the example below.


    Before

    ItemQty
    a3
    b4
    c2


    After

    ItemLabel
    a
    a
    a
    b
    b
    b
    b
    c
    c


    My colleague suggests that I use Macro Excel / VBA for this case. But I'm unfamiliar with it, so really need your help.


    Regards,


  • Standard Module
    How to install your new code
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Press Alt+F11 to open the Visual Basic Editor
    Choose Insert > Module
    Edit > Paste the macro into the module that appeared
    Close the VBEditor
    Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)


    To run the Excel VBA code:
    Press Alt-F8 to open the macro list
    Select a macro in the list
    Click the Run button

  • CROSS POST



    This question has been posted in at least one other forum.


    Do not post any further responses in this thread until a link has been provided to these cross posts.



    Whilst we would rather you didn't cross-post, we know that there may be a valid reason for doing so. All we ask is that you provide the links in your original post to your question in the other forum(s). Read this to understand why.



    This forum is full of volunteers that give up their own time to help others, something that should be respected and not taken for granted. It’s never nice for someone to find out that a problem they have spent time solving for you has already been answered somewhere else without them knowing, and so we ask you to make it clear that you have also asked elsewhere.


    Please provide the link(s). If you are unable to do so, tell us where else you have posted this query.

    Ali :)


    Enthusiastic self-taught user of MS Excel who's always learning!
    If anyone has helped you towards solving a problem, then you can thank them by clicking on the like icon bottom right.

    :!:Forum Rules

Participate now!

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