+ Reply to Thread
Results 1 to 4 of 4

Incremental value with a text prefix and a suffix

Hybrid View

Rowane Incremental value with a text... 09-26-2015, 08:25 AM
jaslake Re: Incremental value with a... 09-26-2015, 10:35 AM
Rowane Re: Incremental value with a... 09-26-2015, 02:57 PM
jaslake Re: Incremental value with a... 09-26-2015, 03:06 PM
  1. #1
    Registered User
    Join Date
    09-26-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    2

    Incremental value with a text prefix and a suffix

    Would appreciate if someone out there could help...I am using the following code to increase my PO number.
    My output should look like this - PO09-001/15 where PO09 is fixed and /15 is fixed. However when i run the macro, it turns out PO09-2/15 instead of PO09-002/15. Please help me correct the code. Thank you very much.


    Dim i As Integer


    Range("C5").Value = "PO09-" & Val(Mid(Range("C5"), 6, Len(Range("C5")) - 5)) + 1 & "/15"

  2. #2
    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: Incremental value with a text prefix and a suffix

    Hi Rowane

    Welcome to the Forum!!!

    Try this
    Formula: copy to clipboard
    = "PO09-" & Format(Val(Mid(Range("C5"), 6, Len(Range("C5")) - 5)) + 1, "000") & "/15"
    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.

  3. #3
    Registered User
    Join Date
    09-26-2015
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    2

    Re: Incremental value with a text prefix and a suffix

    Quote Originally Posted by jaslake View Post
    Hi Rowane

    Welcome to the Forum!!!

    Try this
    Formula: copy to clipboard
    = "PO09-" & Format(Val(Mid(Range("C5"), 6, Len(Range("C5")) - 5)) + 1, "000") & "/15"
    Hi John

    Thank you soooooo much!!!! It solved my problem!!!!! Really appreciate your help!

  4. #4
    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: Incremental value with a text prefix and a suffix

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

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

+ 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. Prefix and Suffix Help
    By Scott Holmes in forum Excel General
    Replies: 3
    Last Post: 10-06-2015, 11:58 AM
  2. [SOLVED] Need to add a text suffix to the end of "all words" by searching for their prefix
    By lorilewis07 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2015, 01:01 PM
  3. vba to remove T of every string of prefix and 1 of suffix with text
    By MicroTees in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2015, 03:10 PM
  4. Retrieve the Text which may have prefix/suffix in the database & retrieve the highestvalue
    By Sivashanmugam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2015, 12:58 PM
  5. Add Suffix & Prefix
    By di22y in forum Excel General
    Replies: 1
    Last Post: 06-25-2009, 06:34 PM
  6. Prefix and Suffix
    By Clare in forum Excel General
    Replies: 2
    Last Post: 01-30-2006, 03:30 PM
  7. Prefix-text, Suffix-text
    By barbiro in forum Excel General
    Replies: 2
    Last Post: 04-09-2005, 05:42 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