Results 1 to 3 of 3

Adding row while increasing ID Number by 1 each time

Threaded View

  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?
    Sub Adduserstory()
    '
    ' Adduserstory Macro
    '
    
    '
        Rows("21:21").Select
        Selection.Insert Shift:=xlDown
        Range("A21").Select
        ActiveCell.FormulaR1C1 = "=R[-1]C+1"
        Range("A22").Select
    End Sub
    Last edited by alansidman; 05-29-2020 at 08:08 AM.

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