Then save and close this code, go back to the worksheet, and enter this formula =removedupes1(A2)( A2 is the data cell you want to remove duplicates from) into a blank cell besides your data, see screenshot:Ĥ. Set xDic = CreateObject("Scripting.Dictionary")ģ. VBA code: Remove duplicate characters of text string in a cell Function RemoveDupes1(pWorkRng As Range) As String Click Insert > Module, and paste the following code in the Module Window. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.Ģ. Here, I can talk about a VBA code to deal with it.ġ. If you have a list of text string, now, you need to remove the duplicate characters as following screenshot shown. Remove duplicate words separated by punctuation with User Defined Function Remove duplicate characters of text string with User Defined Function How could you solve this problem in Excel? Supposing there are duplicate characters or words in each cell, and you want to remove the duplicates and leave only unique characters or words. How to remove duplicate characters or words in string of a cell?
0 Comments
Leave a Reply. |