Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing text from Alphanumeric Values
Hi
I have a column containing alphanumeric values e.g. HG06100 H134679 HC134679 HG05534 A434340 I need a formula or macro help to remove all the text values in the cell and leave all the numbers behind including zero. Could someone please help, thanks Syed |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing text from Alphanumeric Values
Check one of your other posts.
Syed Rizvi wrote: Hi I have a column containing alphanumeric values e.g. HG06100 H134679 HC134679 HG05534 A434340 I need a formula or macro help to remove all the text values in the cell and leave all the numbers behind including zero. Could someone please help, thanks Syed -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing text from Alphanumeric Values
You might use this from Ron Rosenfeld and others. It will remove any text in
any position. Sub RemoveAlpha() Dim tbl As Range, rng As Range With Sheets(1) .Columns("A").NumberFormat = "@" Set tbl = .Range("A1:A5") End With For Each rng In tbl GetNumSlash rng Next End Sub Public Function GetNumSlash(rng As Range) As String Dim i As Long, sStr1 As String, sChar As String For i = 1 To Len(rng) sChar = Mid(rng, i, 1) If Not sChar Like "*[!0-9]*" Then sStr1 = sStr1 & sChar Next rng = sStr1 End Function Geoff "Syed Rizvi" wrote: Hi I have a column containing alphanumeric values e.g. HG06100 H134679 HC134679 HG05534 A434340 I need a formula or macro help to remove all the text values in the cell and leave all the numbers behind including zero. Could someone please help, thanks Syed |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Removing text from Alphanumeric Values
Thanks very much folks, much appreciated
"Geoff" wrote: You might use this from Ron Rosenfeld and others. It will remove any text in any position. Sub RemoveAlpha() Dim tbl As Range, rng As Range With Sheets(1) .Columns("A").NumberFormat = "@" Set tbl = .Range("A1:A5") End With For Each rng In tbl GetNumSlash rng Next End Sub Public Function GetNumSlash(rng As Range) As String Dim i As Long, sStr1 As String, sChar As String For i = 1 To Len(rng) sChar = Mid(rng, i, 1) If Not sChar Like "*[!0-9]*" Then sStr1 = sStr1 & sChar Next rng = sStr1 End Function Geoff "Syed Rizvi" wrote: Hi I have a column containing alphanumeric values e.g. HG06100 H134679 HC134679 HG05534 A434340 I need a formula or macro help to remove all the text values in the cell and leave all the numbers behind including zero. Could someone please help, thanks Syed |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Removing Text from Alphanumeric values | Excel Discussion (Misc queries) | |||
Removing text from Alphanumeric values | Excel Worksheet Functions | |||
VLOOKUP with numeric and alphanumeric values | Excel Discussion (Misc queries) | |||
how do i enter alphanumeric values? | Excel Discussion (Misc queries) | |||
Max-function with alphanumeric values?!? | Excel Programming |