+ Reply to Thread
Results 1 to 7 of 7

VBA to create numerical increment

  1. #1
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    VBA to create numerical increment

    Hello.

    I have a column that contains a repeating word, within a named range. ("Chapter_Range")
    Is it possible to add an incremental value at the end of this word throughout the named range?

    As an example, given the name "Chapter"

    From this:

    Bill
    Chapter
    John
    Robert
    Chapter
    Mary
    Chapter

    to this

    Bill
    Chapter 1
    John
    Robert
    Chapter 2
    Mary
    Chapter 3


    If this is difficult, Having the increment appear in the adjacent cell would also work (although the above request would be preferred)
    I will be adding new rows in between, so a VBA script will allow me to manually update via button, when needed.

    Thanks for any help

    Jeff

    .
    Last edited by jeff p; 08-14-2012 at 10:42 AM.

  2. #2
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Karlstad, Sweden
    MS-Off Ver
    Excel 2016
    Posts
    232

    Re: VBA to create numerical increment

    Please Login or Register  to view this content.

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: VBA to create numerical increment

    This should work

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: VBA to create numerical increment

    Thanks for the help!

    Both codes worked great.

    Unfortunately, It seems I overlooked a flaw in my initial request.

    My intention was to have the ability to add new Chapter rows in between, and update their numerical value.


    Can the code be modified to also include a previous incremental value at the end

    something like Chapter *

    Thanks again for the help!

    Jeff

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: VBA to create numerical increment

    So if you added a new chapter inbetween what number would that chapter be?

    Bill
    Chapter 1
    John
    Robert
    Chapter 2
    Mary
    Chapter 3

    Bill
    Chapter 1
    John
    Robert
    Chapter 'What would this be 2 or 3
    Mary
    Chapter 2

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: VBA to create numerical increment

    Please Login or Register  to view this content.
    Last edited by shg; 08-14-2012 at 10:45 AM.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: VBA to create numerical increment

    Yes

    Thank you SHG


    That did it!!

    Thanks for all the help on this from everyone!

    Jeff
    Last edited by jeff p; 08-14-2012 at 10:40 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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