+ Reply to Thread
Results 1 to 3 of 3

Adding row while increasing ID Number by 1 each time

  1. #1
    Registered User
    Join Date
    05-28-2020
    Location
    Scottsdale
    MS-Off Ver
    2019
    Posts
    1

    Adding row while increasing ID Number by 1 each time

    Hello,

    I am trying to create a macro that will add a row while increasing the ID number by one each time. For example, there are currently 10 rows with IDs of 1 to 10. When I run the Macro I want to add a row under row 10 and give it the ID of 11. When I run it again I want it to add a row under ID 11 and give it the ID of 12 and so on. My current macro (below) works the first time I run it, adding a row and assigning it the ID of 11, however, when I run it the second time it adds a row but gives it the ID of 11. This should be 12. How do I fix this?
    Please Login or Register  to view this content.
    Last edited by alansidman; 05-29-2020 at 08:08 AM.

  2. #2
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Adding row while increasing ID Number by 1 each time

    Like this?
    Please Login or Register  to view this content.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,810

    Re: Adding row while increasing ID Number by 1 each time

    Code Tags Added
    Your post does not comply with Rule 2 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.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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] Find number in parenthesis and replace with text and increasing number
    By lamdathoa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2020, 10:09 AM
  2. Copy live increasing data to a static tab while adding a date & time stamp
    By pmw19800 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-16-2020, 03:16 PM
  3. [SOLVED] Adding a VLOOKUP to an increasing / decreasing number of rows
    By fuzzyjonclay123 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-21-2018, 06:46 AM
  4. [SOLVED] Adding increasing values to numbers with dashes
    By FSCGunslinger in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-02-2015, 02:06 PM
  5. I need to print blank invoices with increasing invoice number each time - HELP
    By Leanne44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2014, 01:35 PM
  6. Replies: 8
    Last Post: 04-22-2013, 11:56 PM
  7. Adding a Number value to Time
    By Corey in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-25-2006, 11:55 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