+ Reply to Thread
Results 1 to 7 of 7

Identify certain ASCII characters in a text.

  1. #1
    Registered User
    Join Date
    02-16-2005
    Location
    Dubai, UAE
    MS-Off Ver
    365
    Posts
    40

    Identify certain ASCII characters in a text.

    Hello, I have to clean up a database that might contain characters with text not compliant to an old application.

    Permitted text is:
    A-Z (capitals and small letters),
    0-9,
    . (dot),
    , (comma),
    - (dash),
    (space)

    OBJECTIVE: If a cell contains characters other than those, excel should return an information stating this (no need to specify which position the error is at). A simple message is enough.

    I would need this as a formula in some way, or a macro that will automatically run without manual input such as clicking on a button or so...

    Is this feasible and if, could you let me know how I can accomplish this?
    The field length is usually 128 characters.

    I thank you all and know, that if nobody can answer me here, it probably can't be done (which I doubt ;-)

    Thanks!!!

    Titus.

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by titushanke
    Hello, I have to clean up a database that might contain characters with text not compliant to an old application.

    Permitted text is:
    A-Z (capitals and small letters),
    0-9,
    . (dot),
    , (comma),
    - (dash),
    (space)

    OBJECTIVE: If a cell contains characters other than those, excel should return an information stating this (no need to specify which position the error is at). A simple message is enough.

    I would need this as a formula in some way, or a macro that will automatically run without manual input such as clicking on a button or so...

    Is this feasible and if, could you let me know how I can accomplish this?
    The field length is usually 128 characters.

    I thank you all and know, that if nobody can answer me here, it probably can't be done (which I doubt ;-)

    Thanks!!!

    Titus.
    Hi,

    in which column or columns is the data?

    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Forum Contributor
    Join Date
    11-16-2004
    Posts
    282

    Loop through cells & characters for non-ASCII

    Here'a a macro that will work for you:
    Please Login or Register  to view this content.
    Hope this helps,
    theDude

  4. #4
    Registered User
    Join Date
    02-16-2005
    Location
    Dubai, UAE
    MS-Off Ver
    365
    Posts
    40
    Thank you for the great macro! Works fantastically, I am really impressed!

    How I could I change the macro to check in one specific CELL only?
    Just out of curiousity, I would like to implement a little error check when users input new data in a field.


    It would be greeat that as soon as they enter the text and press "ENTER", a message pops up alerting them of the error...

    Is that possible? Let's say, the text being in cell A2...

    Thanks again and big respect to your skills...

    Titus

  5. #5
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Titus

    Copy this macro
    GoTo Excel
    Select Sheet you want macro to autocheck entry of A2
    Right Click on Sheet Name Tab > select View Code
    Past macro into the Worksheet Module displayed

    Note: Code does not force user to fix the mistake.
    Remove ' from rng.clearcontents to force user to re-enter correct data (clears the cell contents)

    Please Login or Register  to view this content.
    Last edited by mudraker; 02-06-2007 at 07:06 AM.

  6. #6
    Registered User
    Join Date
    02-16-2005
    Location
    Dubai, UAE
    MS-Off Ver
    365
    Posts
    40
    Hi mudraker,

    Thank you for the macro, it is exactly what I wanted! The only thing is, there is something that is not working, as the macro is displaying an error even if the characters are all valid (tried with the word "TEST", no quotation marks obviously).

    See attached screenshot.. Anything I have done wrong, although I did follow the instructions with regards to inserting the macro in the work sheet...?

    Thanks, Titus.
    Attached Images Attached Images

  7. #7
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Sorry I posted the wrong version

    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