+ Reply to Thread
Results 1 to 11 of 11

VBA to duplicate cell and continue numbering

  1. #1
    Forum Contributor
    Join Date
    04-05-2013
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    360

    VBA to duplicate cell and continue numbering

    Is there a code that will duplicate/insert a new row and continue the numbering system that is in column A. In the attached example I use the following code to duplicate the row that is above the cell that contains the letters "BO". In column A I have a numbering system for each row; ie SU-1, SU-2, SU-3, etc. I would like to click the button and add a new row and to contine the next number in line. So if the last row was SU-9, i would like the new row to = SU-10.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by adamheon; 10-24-2013 at 11:21 AM.

  2. #2
    Forum Contributor
    Join Date
    04-25-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    150

    Re: VBA to duplicate cell and continue numbering

    I think this will do it:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to duplicate cell and continue numbering

    Another approach
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    04-05-2013
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    360

    Re: VBA to duplicate cell and continue numbering

    When i use djdjdj's code it resets at 10. So after item 10 or goes back to 1. Is there a way for it to continue numbering 11,12,13,etc?

  5. #5
    Forum Contributor
    Join Date
    04-05-2013
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    360

    Re: VBA to duplicate cell and continue numbering

    i tried the code from jaslake and that didnt work. It kept the numbering at 1 and did not increase. FYI.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to duplicate cell and continue numbering

    Works for me...see attached...
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    04-05-2013
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    360

    Re: VBA to duplicate cell and continue numbering

    my apologies. it works perfect! I must have modified it incorrectly. Thanks for your help.

    is there a way for it to clear cells D, E and F at the same time it duplicates? (not sure if i should start a new thread or not)

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to duplicate cell and continue numbering

    Add the line of Code as indicated
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    04-05-2013
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    360

    Re: VBA to duplicate cell and continue numbering

    Thank you very much. That was a huge help.

  10. #10
    Registered User
    Join Date
    06-26-2013
    Location
    Spokane
    MS-Off Ver
    Excel 2007
    Posts
    15

    re: VBA to duplicate cell and continue numbering

    jaslake's works for me.

    Or for START-UP you could have cheated and said:
    Please Login or Register  to view this content.
    But that wouldn't have solved anything if you tried to do BO also.

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to duplicate cell and continue numbering

    You're welcome...glad I could help.

+ 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. Sequence numbering for each duplicate record
    By excel.help in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-01-2011, 05:48 PM
  2. sequential numbering duplicate data
    By mlopardo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-08-2010, 04:11 PM
  3. sequential numbering duplicate data
    By mlopardo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-08-2010, 03:44 PM
  4. random numbering-Why do I get duplicate numbers?
    By Gloria in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-19-2005, 09:05 PM

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