+ Reply to Thread
Results 1 to 2 of 2

Macro/VBA code to duplicate every N-th row, N times

  1. #1
    Registered User
    Join Date
    10-26-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    3

    Macro/VBA code to duplicate every N-th row, N times

    Hi,
    *
    I'm a newbie to VBA and macro so I need help with a script/code that can duplicate every 17th row, four number of times. This should be a loop.
    *
    I have attached a part of my dataset. I want to duplicate every 17th row because I have a new 'Id' after every 17th row.*
    Attached Images Attached Images

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Macro/VBA code to duplicate every N-th row, N times

    Hi, VBA hardly can work on the image. Please consider attaching a sample workbook not a screenshot (see yellow banner near the top).

    As a general rule: in such case it's usually good idea to use reversed loop so assuming your last x * 17 is filled it could go like that:


    Please Login or Register  to view this content.
    Best Regards,

    Kaper

+ 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. Macro to make every row duplicate 10 times
    By katylittell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2017, 10:09 PM
  2. [SOLVED] Need Macro to search for duplicate times across many tabs in a spreadsheet
    By sflynn31 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-13-2016, 04:07 PM
  3. how to used macro code to record data which change over the times
    By eexcel.ca in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-29-2014, 07:41 PM
  4. Macro for running the SQL code multiple times
    By sawoodalam1989 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2013, 08:35 PM
  5. I need a macro that will let me loop a section of the vba code x number of times
    By tuckejam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-28-2013, 02:44 PM
  6. [SOLVED] Need a Macro that will duplicate rows a number of times based on a column value
    By Lassitude in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2013, 12:04 PM
  7. macro to delete entire row of duplicate dates and times dd/mm/yyyy hh:mm:ss
    By bradyj2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2011, 05:41 AM

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