+ Reply to Thread
Results 1 to 2 of 2

Remove Text from String Converting Numbers to Integer

  1. #1
    Registered User
    Join Date
    05-27-2020
    Location
    Newport, Wales
    MS-Off Ver
    365
    Posts
    3

    Remove Text from String Converting Numbers to Integer

    How do I remove text from a string "MIC-CT-001", and convert the remaining numbers as an Integer, where I can add 1 to the numeric, convert back to a string and push back to the Spreadsheet?

    Please Login or Register  to view this content.
    Unfortunately this is as far as I can go without removing the text from the string and converting it to an Integer.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,057

    Re: Remove Text from String Converting Numbers to Integer

    Your code will error out, because you have NextID dimmed as an Integer but your code builds a string. Assuming your format for the ID's is always going to have MIC-CT-number then try this:

    Please Login or Register  to view this content.
    Since you started with -001 I assumed you want at least 3 digits and that we should pad "NextNumber" with 0s as needed.
    Last edited by Arkadi; 06-26-2020 at 10:46 AM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

+ 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. [SOLVED] Remove text from string, return numbers
    By phbryan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2019, 12:30 PM
  2. [SOLVED] Converting string containing numbers and text to currency and text
    By Cumberland in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-06-2016, 05:05 AM
  3. Remove Numbers from a string of text
    By ashy2287 in forum Excel General
    Replies: 4
    Last Post: 01-12-2016, 02:34 AM
  4. Remove numbers from text string in one cell
    By Greg_Sendandreceive in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2015, 11:46 AM
  5. Remove numbers from text string
    By mkvassh in forum Excel General
    Replies: 2
    Last Post: 09-23-2011, 07:37 AM
  6. converting from a string to integer in an array
    By jerseyguy1996 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2009, 05:40 PM
  7. Converting Text String to Separate Numbers
    By Cincy in forum Excel General
    Replies: 1
    Last Post: 06-07-2006, 05:30 AM

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