+ 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
    60

    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
    60

    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
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    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!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    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
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    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)

Similar Threads

  1. Adding extra rows within a spreadsheet
    By barneyrubble1965 in forum Excel General
    Replies: 1
    Last Post: 11-28-2017, 02:16 PM
  2. Converting rows to columns and adding extra rows as required
    By teco in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-09-2016, 04:18 PM
  3. [SOLVED] Adding Extra Range To Table
    By zanshin777 in forum Excel General
    Replies: 2
    Last Post: 11-18-2015, 09:38 AM
  4. [SOLVED] Offset with Counta for picture of dynamic table is adding extra row to pic
    By Steve N. in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-07-2014, 05:29 PM
  5. Adding an extra column to a pivot table.
    By hello its dean in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-18-2013, 06:05 PM
  6. Replies: 8
    Last Post: 08-27-2012, 04:37 PM
  7. Macro to insert extra rows in a table
    By Jonathan Oz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2005, 10:06 PM

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