+ Reply to Thread
Results 1 to 7 of 7

Macro adding 4 extra rows for each value of a specific table

  1. #1
    Registered User
    Join Date
    06-23-2015
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    59

    Macro adding 4 extra rows for each value of a specific table

    Dears,

    I am not very skilled in designing VBA macro's and I hope you could help me,

    I have put you a draft of what I am looking for in attached,

    I was looking for a macro, copying independantly all Product references from sheet "SKU list" A5:A91 and also all description B5:B91,
    And pasting it into sheet "overview a part from A3,

    For each copy paste I would like the macro to provide for each reference a total of 5 rows with the texts contained in sheet SKU list G4:G8, and copy it in sheet overview in column C,

    I have put you an example in attached with some comment, hope it will be clearer,

    I also would like that the macro just have an effect/impact on the 3 first columns, and that it is dynamic according to the #references I could have in Sku list sheet in column A/B

    Thanks so much in advance for your help guys ..

    Regards,
    Attached Files Attached Files
    Last edited by St3ff3ns; 01-03-2018 at 05:30 AM.

  2. #2
    Forum Contributor
    Join Date
    06-12-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    167

    Re: Macro adding 4 extra rows for each value of a specific table

    Try this

    Please Login or Register  to view this content.
    It should do what you are requesting. I added comments to show where to change things in order to match your master sheet.
    This is dynamic and will find how many products you have in the database.
    Let me now if you have any questions

  3. #3
    Registered User
    Join Date
    06-23-2015
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Macro adding 4 extra rows for each value of a specific table

    Hi Dougman,

    Thank you for your help on this and your quick answer,

    When i am trying to thrigger the macro, i am receiving the following error : "Compile errror : Expected end sub"

    Here-below the code I pasted :
    Please Login or Register  to view this content.
    Thanks in advance for your help,

    Regards,
    Last edited by St3ff3ns; 01-03-2018 at 05:08 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2013 (Win 10 - Work) & 2016 365 Subscription (Win 10 - Home)
    Posts
    16,011

    Re: Macro adding 4 extra rows for each value of a specific table

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    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 their reputation star bottom left.

  5. #5
    Registered User
    Join Date
    06-23-2015
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Macro adding 4 extra rows for each value of a specific table

    Hi Ali,

    Thanks for the info, it is now adapted,

    Steffen

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2013 (Win 10 - Work) & 2016 365 Subscription (Win 10 - Home)
    Posts
    16,011

    Re: Macro adding 4 extra rows for each value of a specific table

    Thanks!

  7. #7
    Forum Contributor
    Join Date
    06-12-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    167

    Re: Macro adding 4 extra rows for each value of a specific table

    You need to get rid of the line sub test. This is because you have the sub routine started with the command button click. Simply clearing that line will solve your problems.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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