+ Reply to Thread
Results 1 to 5 of 5

Excel 2003/2007 Problem with InStr, Replace, and Len

  1. #1
    Registered User
    Join Date
    02-22-2009
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2007
    Posts
    2

    Excel 2003/2007 Problem with InStr, Replace, and Len

    I have run into a brick wall with InStr, Replace, and Len. I take the data from the active cell (formatted as text). I need to cleanup the data and do further massaging of it. In testing cleanup code, I get behavoirs and results I simply don't understand and can't figure out from hours searching forums many places.

    The following simplified example commented code can be cut/pasted into a new spreadsheet module and should be self-explanatory. Example data is in the comments. All help greatly appreciated.

    Data is entered by multiple users and multiple sources. Therefore there is no control over the input quality so extraneous characters and multiple repeated periods and spaces can show up anywhere.

    Please Login or Register  to view this content.
    Last edited by TNZooKeeper; 02-23-2009 at 06:33 PM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Excel 2003/2007 Problem with InStr, Replace, and Len

    This might help

    Please Login or Register  to view this content.
    A string of periods can get automatically converted to an Ellipsis which is ASCII character 133.
    Martin

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

    Re: Excel 2003/2007 Problem with InStr, Replace, and Len

    Welcome to the forum.

    Try this:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    02-22-2009
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2007
    Posts
    2

    Smile Re: Excel 2003/2007 Problem with InStr, Replace, and Len

    MRICE and SHG,
    Thanks.
    MRICE's code nailed it. Multiple periods must be getting converted to ellipsis. That is incredibly subtle.
    Thanks again.

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

    Re: Excel 2003/2007 Problem with InStr, Replace, and Len

    You’re welcome. Would you please mark the thread as Solved?

    Click the Edit button on your first post in the thread

    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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