How to Remove Numbers From Text Strings in Excel?


With the help of Excel, you can manage and alter data in a variety of ways. One frequent activity is working with text strings that contain numerical characters. This post will help you through the procedures to effectively remove numbers from your text strings, whether you have a dataset with mixed alphanumeric entries or need to extract text from a cell containing numbers. No matter what degree of Excel experience you have, you can follow along because we'll start with the fundamentals and then progressively move on to more complex strategies.

Remove Numbers From Text Strings

Here, we will first create a formula using VBA and then use the formula to complete the task. So let us see a simple process to learn how you can remove numbers from text strings in Excel.

Step 1

Consider an Excel sheet where you have a list of strings that contain both text and numbers, similar to the below image.

First, right-click on the sheet name and select View code to open the VBA application.

Right-click > View Code.

Step 2

Then click on Insert and select Module, then copy the below code into the text box.

Insert > Module > Copy.

Code

Function RemoveNumbers(Txt As String) As String
With CreateObject("VBScript.RegExp")
.Global = True
.Pattern = "[0-9]"
RemoveNumbers = .Replace(Txt, "")
End With
End Function

Step 3

Then close VBA using Alt + Q. Then click on an empty cell and enter the formula as =RemoveNumbers(A2), click enter, and drag down using the autofill handle.

Alt + Q > Empty Cell > Formula > Enter > Drag.

This is how you can remove numbers from text strings in Excel.

Conclusion

In this tutorial, we have used a simple example to demonstrate how you can remove numbers from text strings in Excel to highlight a particular set of data.

Updated on: 08-Sep-2023

755 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements