Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub RemoveAlphas()
' Remove alpha characters from a string. ' except for decimal points. Dim intI As Integer Dim rngR As Range, rngRR As Range Dim strNotNum As String, strTemp As String Set rngRR = Selection.SpecialCells(xlCellTypeConstants, _ xlTextValues) For Each rngR In rngRR strTemp = "" For intI = 1 To Len(rngR.Value) If Mid(rngR.Value, intI, 1) Like "[0-9.]" Then ' adjust to [0-9] if do not want decimal pts. strNotNum = Mid(rngR.Value, intI, 1) Else: strNotNum = "" End If strTemp = strTemp & strNotNum Next intI rngR.Value = strTemp Next rngR End Sub Gord Dibben MS Excel MVP On Mon, 14 Aug 2006 17:20:53 -0400, excelator wrote: For example I have data MK12345 and would like to remove the text from that so I only have the numerica value return. What VBA code do I use? PS: Is there a list somehwere which will list description of all the functions available? Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find & Replace text format | Excel Discussion (Misc queries) | |||
Finding specific text in a string | Excel Worksheet Functions | |||
Text string and sum | Excel Worksheet Functions | |||
Remove last character of text string | Excel Worksheet Functions | |||
dynamic cell reference within a text string | Excel Worksheet Functions |