+ Reply to Thread
Results 1 to 3 of 3

Creating sequencial incremental number for rows of a data table in a special format

  1. #1
    Registered User
    Join Date
    04-21-2016
    Location
    Israel
    MS-Off Ver
    Office 2016
    Posts
    52

    Creating sequencial incremental number for rows of a data table in a special format

    Hi friends,

    I will appreciate your help here...

    I need to create in VBA a sequential incremental numbering for rows of a data table. It should be quite simple using some loop, but the challenge here is that the numbers should be created in a special format of 6 digits in any case.
    For the first row number should be '000001' and increases by one in the next row, and so on, as showed in the example below.

    Sequential numbers should be given to all table's rows and stop when table ends. Macro needs to support this action dynamically, for changing number of rows.
    The headers of the table are in row 1, the sequential numbers should be created in column A (starting A3), according to the filled cells in column B of the table.

    I'll be glad for a simple code, as much as possible.

    Thanks in advance

    ---

    000001
    000002
    .
    .
    .
    000099
    000100
    .
    .
    .
    000999
    001000
    .
    .
    .
    009999
    010000
    .
    .
    .
    999999


    * Table has less rows than the maximum here, so solution is not needed for >999999.
    Last edited by liorc13; 07-21-2019 at 02:35 PM.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Creating sequencial incremental number for rows of a data table in a special format

    Hi
    simply numbering the rows and setting the format for column A to 000000 will give you numbers appearing as you specify.
    If instead you want to include strings with a " ' " in front then this macro will add strings in column A from cell A3 for as long as column B is not empty

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-21-2016
    Location
    Israel
    MS-Off Ver
    Office 2016
    Posts
    52

    Re: Creating sequencial incremental number for rows of a data table in a special format

    Wow... Thanks a lot Nicky! Works perfect. Really appreciate your quick and professional support
    Last edited by liorc13; 07-22-2019 at 02:09 AM.

+ 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. Replies: 8
    Last Post: 05-30-2017, 11:39 AM
  2. [SOLVED] Sequencial number 0.2.4.6.8.10// 0.3.6.9.12.15// 0.4.8.12.16.20
    By XLalbania in forum Excel General
    Replies: 6
    Last Post: 01-18-2017, 07:04 PM
  3. [SOLVED] Creating an incremental formula whilst using data from a second sheet
    By furn355 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-30-2016, 06:48 AM
  4. [SOLVED] Create sequencial number list to use for Data Validation
    By llamafarmer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-01-2016, 07:35 AM
  5. Creating sequencial folders
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2011, 07:07 AM
  6. [SOLVED] excel data label format special number characters (part 2)
    By todd in forum Excel General
    Replies: 1
    Last Post: 05-04-2005, 12:06 PM
  7. excel data label format special number characters
    By todd in forum Excel General
    Replies: 0
    Last Post: 05-04-2005, 09:06 AM

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