+ Reply to Thread
Results 1 to 5 of 5

Create a specific number of consecutive rows based on row count input

  1. #1
    Registered User
    Join Date
    01-10-2017
    Location
    Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Create a specific number of consecutive rows based on row count input

    Hi!

    I have the following input data in my excel sheet (three columns Prefix, ID, Row count) with some sample data (first three rows):

    Prefix ID Row count
    XYZ 9000 5
    ZDF 7504 2
    BBH 1004 3

    What i am looking for is a mechanism which will generate the number of new IDs based on the row count input (including the prefix). So the output of the three example rows would look like this:

    XYZ-9000
    XYZ-9001
    XYZ-9002
    XYZ-9003
    XYZ-9004
    ZDF-7504
    ZDF-7505
    BBH-1004
    BBH-1005
    BBH-1006

    Using a function I can get the prefix and IDs concatenated and ascending from the starting point, but I don't know how to include the row count input to stop after the correct amount of rows. How would I design a macro to take this into account?

    Thanks & Regards,
    Goodlite

  2. #2
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: Create a specific number of consecutive rows based on row count input

    Hi Goodlite,

    Try this:

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

    If you feel someone has helped you please thank them and click on the star on their post to add reputation.
    Please ensure that you use code tags where relevant, and mark solved threads as solved.
    Most of all please be respectful and understanding of others.

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Create a specific number of consecutive rows based on row count input

    Similar but different
    With headers in row 1, and data staring in row 2
    Please Login or Register  to view this content.
    Last edited by kev_; 01-10-2017 at 08:20 PM.

  4. #4
    Registered User
    Join Date
    01-10-2017
    Location
    Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Create a specific number of consecutive rows based on row count input

    Thanks a bunch you both! I was able to learn and use this successfully.

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Create a specific number of consecutive rows based on row count input

    You are welcome
    Thanks for the rep

+ 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. [SOLVED] Count Consecutive Days Based on Unique Number
    By Kimston in forum Excel General
    Replies: 5
    Last Post: 11-23-2014, 04:46 PM
  2. [SOLVED] Count number of consecutive rows of equal value?
    By Johnington in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-27-2013, 02:40 AM
  3. Replies: 4
    Last Post: 05-30-2013, 06:00 PM
  4. [SOLVED] Count Rows Based On User Input & Trigger Print Of Pages Out Of Count Result
    By wliang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2012, 02:45 AM
  5. Create mutiples Cells based on input number
    By perrierf in forum Excel General
    Replies: 3
    Last Post: 10-28-2011, 08:11 AM
  6. Replies: 0
    Last Post: 06-15-2011, 09:46 AM
  7. Function to Count Number of Consecutive Rows with a Specific Criteria?
    By Templee1 in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 09-06-2005, 03:05 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