How to remove numbers from cells which containing texts and numbers in Excel?
This article is talking about removing all numbers from cells which containing texts and numbers, and keep only the texts in these cells as below screenshot shown.
Excel Productivity Tools
Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial
Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately. 60-day Unlimited Free Trial
The following User-defined function can help you to remove all numbers from cells and keep only texts. Please do as follows.
1. Press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, click Insert > Module. Then copy and paste the below VBA code into the Code window. See screenshot:
VBA code: Remove numbers from cells which containing texts and numbers
Function OnlyRemoveNumbers(strTxt As String) As String Application.ScreenUpdating = False With CreateObject("VBScript.RegExp") .Global = True .Pattern = "[0-9]" OnlyRemoveNumbers = .Replace(strTxt, "") End With Application.ScreenUpdating = True End Function
3. Press the Alt + Q keys to close the Microsoft Visual Basic for Applications window.
4. Select a blank cell, enter formula =OnlyRemoveNumbers(A2) into the Formula Bar, and then press the Enter key to get the result. Keep selecting the result cell, drag its Fill Handle down to get all results. See screenshot:
You can use the Remove Characters utility of Kutools for Excel to easily remove all numbers from selected cells, and keep only texts.
1. Select the cells you need to remove numbers and keep texts only, then click Kutools > Text > Remove Characters. See screenshot:
2. In the Remove Characters dialog box, only check the Numeric box in the Remove Characters section, and then click the OK button. See screenshot:
Then all numbers are removed from the selected range, and only the texts are kept.
Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 60 days. Download the free trial now!