+ Reply to Thread
Results 1 to 3 of 3

VB Code to remove special characters and bring just TEXT

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to remove special characters and bring just TEXT

    Hello:

    Please refer to attached file.

    I have data in cplumn A as show " #Name?" but the actual cell contents have text.
    I need VB Code to remove the special characters from the content of the cell and display
    the actual TEXT only.

    Example :

    Cell A2 = "=+ Cash Tips Received"

    I need it to convert to
    A2 = Cash Tips Received

    Let me know if you have any questions.
    Thanks.
    Riz
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,112

    Re: VB Code to remove special characters and bring just TEXT

    How about
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-24-2013
    Location
    Penang, Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VB Code to remove special characters and bring just TEXT

    Something like this. Just modify to your need

    Sub CleanCell()

    Dim n As Long, i As Long
    Dim strX As String, strCode As String, Char As String, strExtract As String
    Dim wb As Workbook
    Dim ws As Worksheet

    Set wb = ActiveWorkbook
    Set ws = wb.Sheets(1)

    strCode = "[A-Z.a-z 0-9]"

    For n = 10 To 32
    strExtract = ""
    strX = ws.Range("A" & n).Formula
    If Not strX = "" Then
    For i = 1 To Len(strX)
    Char = Mid(strX, i, 1)
    If Char Like strCode Then
    strExtract = strExtract & Char
    End If
    Next
    End If
    ws.Range("A" & n) = Trim(strExtract)
    Next

    End Sub

+ 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] how remove all special characters except # , & - .
    By Latha Mani in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-13-2014, 07:14 AM
  2. [SOLVED] Remove ALL Special Characters
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2013, 08:12 PM
  3. Replies: 8
    Last Post: 12-17-2012, 05:30 AM
  4. Remove special characters
    By humacdeep in forum Excel General
    Replies: 6
    Last Post: 01-14-2012, 03:36 PM
  5. Remove All Text,Special Characters, & Spaces
    By g48dd in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-01-2011, 09:24 AM
  6. Remove Special Characters
    By bkatzman in forum Excel General
    Replies: 10
    Last Post: 04-13-2010, 11:51 AM
  7. REMOVE SPECIAL CHARACTERS FROM TEXT CELLS
    By javila255 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-02-2005, 02:06 PM

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