+ Reply to Thread
Results 1 to 6 of 6

removing punctuation macro

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    removing punctuation macro

    Is there any macro.. to remove ;/, in the words in the cell
    I have total 2000 row words

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: removing punctuation macro

    Hi

    Have you tried the standard Find & Replace functionality.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: removing punctuation macro

    i want a macro.. yes.. i did.. but it is giving incorrect..

  4. #4
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: removing punctuation macro

    Quote Originally Posted by dorabajji View Post
    i want a macro.. yes.. i did.. but it is giving incorrect..
    Then the example of your data is necessary.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: removing punctuation macro

    As BMV says, please upload your workbook.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: removing punctuation macro

    "in the words in the cell" means to me that you have multiple words in a cell separated by a space and that each word might have one of these characters.
    Sub Maybe()
    Dim a, b, i As Long, ii As Long, j As Long, c As Range
    Application.ScreenUpdating = False
    b = Array(",", ":", "/", ";", """", "'")    '<---- Characters to be replaced by ""
        For Each c In Range("A2:A" & Cells(Rows.Count, 1).End(xlUp).Row)
            a = Split(c, " ")
                For i = LBound(a) To UBound(a)
                    For j = LBound(b) To UBound(b)
                        a(i) = Replace(a(i), b(j), "")
                    Next j
                Next i
            For ii = LBound(a) To UBound(a)
                c.Offset(, 1).Value = c.Offset(, 1).Value & a(ii) & " "
            Next ii
        c.Offset(, 1).Value = Left(c.Offset(, 1), Len(c.Offset(, 1)) - 1)
        Next c
    Application.ScreenUpdating = True
    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] Changing and adding punctuation in a split macro?
    By dark91zc in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-02-2013, 05:09 PM
  2. Replies: 2
    Last Post: 02-06-2013, 12:13 AM
  3. Replies: 0
    Last Post: 02-05-2013, 07:51 AM
  4. Macro to highlight cells which have content with an end punctuation
    By Athi123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-31-2013, 03:04 AM
  5. Removing punctuation from a string
    By hazzacanary in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2012, 10:29 PM
  6. Removing punctuation in a formula
    By williscm in forum Excel General
    Replies: 2
    Last Post: 06-18-2009, 12:30 AM
  7. Removing Punctuation
    By silvertt in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-25-2007, 06:43 AM
  8. Remove all punctuation.
    By Dr.Jamescook in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2005, 05:06 AM

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