Results 1 to 4 of 4

Keep leading zeros

Threaded View

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,192

    Keep leading zeros

    How do I keep leading zeros in this code? I am incrementing a value with in a string.

    TextBox1.value = "PRO 001"
        If CheckBox1.Value = True Then
        TextBox2.Value = Left(TextBox1.Value, 4) & Replace(TextBox1.Value, "PRO ", "") + 1
        Else
        TextBox2.Value = ""
        End If
    The output is "PRO 2" I need the leading zeros so the output is "PRO 002".
    IE:
    "PRO 098" would be "PRO 099"
    "PRO 099" would be "PRO 100" (No longer need leading zero)
    Last edited by Rick_Stanich; 10-22-2008 at 02:55 PM.
    Regards

    Rick
    Win10, Office 365

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