How to create and use a function that removes all text or all numbers from a cell, whichever you want.
To do this, we will create a UDF or User Defined Function in Excel.
But, I won't make you start from scratch; if you want to get the functions right away, simply download the Excel file attached to this tutorial and copy the code for yourself or get it from below.
How to Install and Use these Functions
If you just want the code and already know what to do with a UDF, here it is.
Function KillText(text_value As Range)
  Â
   ValueInput = text_value.Value
  Â
   ValueResult = ""
  Â
   n = Len(ValueInput)
  Â
   For i = 1 To n
  Â
       InputCharacter = Mid(ValueInput, i, 1)
      Â
       If InputCharacter Like "[0-9]" Then
      Â
           ValueResult = ValueResult & InputCharacter
          Â
       End If
      Â
   Next i
      Â
   KillText = ValueResult
      Â
End Function
Function KillNumbers(text_value As Range)
  Â
   ValueInput = text_value.Value
  Â
   ValueResult = ""
  Â
   n = Len(ValueInput)
  Â
   For i = 1 To n
  Â
       InputCharacter = Mid(ValueInput, i, 1)
      Â
       If InputCharacter Like "[A-Za-z]" Then
      Â
           ValueResult = ValueResult & InputCharacter
          Â
       End If
      Â
   Next i
      Â
   KillNumbers = ValueResult
      Â
End Function
In order to get these functions to work, we first need to install them into Excel.
That's all there is to it!
To kill the text and numbers from a cell, I created a UDF or User Defined Function. This is basically a macro that allows for the creation of a custom function in Excel.
Check out the tutorial on User Defined Functions in Excel for more information on those.
Make sure to download the sample file attached to this tutorial so you can copy/paste the code with ease and see the examples at work in Excel.