+ Reply to Thread
Results 1 to 14 of 14

Excel 2008 : Formula to remove consecutive capital letters from text strings

Hybrid View

  1. #1
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,172

    Re: Formula to remove consecutive capital letters from text strings

    With VBA a simple UDF should work:
    Function CleanCapsAndNumbers(rngCheck As Range) As String
       Dim RegExp            As Object
       Dim strInput As String
       Dim strPattern As String
       Set RegExp = CreateObject("vbscript.regexp")
       strInput = rngCheck.Value
       strPattern = "([A-Z][A-Z]+|\d)"
       With RegExp
          .Global = True
          .Pattern = strPattern
          CleanCapsAndNumbers = Application.Trim(.Replace(strInput, ""))
       End With
    End Function
    Everyone who confuses correlation and causation ends up dead.

  2. #2
    Registered User
    Join Date
    07-02-2012
    Location
    United States
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    6

    Talking Re: Formula to remove consecutive capital letters from text strings

    Thanks for your help!! I really appreciate it.
    Not to push my luck... but if either of you have any bright ideas about how to make this work across languages with different characters (e.g. Chinese, Arabic, Greek, etc.), let me know!
    You guys rock!

    PS. Re: MarvinP, definitely worth it -- I need to fill out about 40,000 rows for at least 29 different languages, for a total of something like 1,160,000 rows total.
    Last edited by JesseG123; 07-08-2012 at 11:20 PM.

+ 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