+ Reply to Thread
Results 1 to 3 of 3

Changing numbers from text format to number format

  1. #1
    Registered User
    Join Date
    12-14-2011
    Location
    Rochester, MN, USA
    MS-Off Ver
    Office 2010 and 365
    Posts
    54

    Changing numbers from text format to number format

    Hello all!
    I have a large macro that copies data around and formats some of it.
    The data I am working with comes from the internet, so any numeric values are in text format.
    I am trying to use the following code to change those numeric values back to numeric format:
    Please Login or Register  to view this content.
    This WOULD work, however I have a mix of values. Some of my values are "123456" while others may be "123-456" or "ABC-123-456"
    I only want the actual numeric values changed (123456).
    The code above will error out on anything that is not in numeric format.

    Can someone provide some extra code that would do this for me?
    Thanks!
    Last edited by garden_gnome; 02-09-2012 at 12:48 PM. Reason: Solved

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Changing numbers from text format to number format

    Maybe:

    Please Login or Register  to view this content.
    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    12-14-2011
    Location
    Rochester, MN, USA
    MS-Off Ver
    Office 2010 and 365
    Posts
    54

    Re: Changing numbers from text format to number format

    GREAT!

    I did modify that code slightly so that it will skip blanks.
    THANKS MUCH!!!

    Please Login or Register  to view this content.

+ 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