Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
gdd6936
 
Posts: n/a
Default How do I make letters not show up in a alpha-numeric string?

I have data that appears like this: "R1-C2-D1-12". I would like the same data
appear in another column like this: "1-2-1-12". How can I make this happen
without spending hours typing it in, I have several thousand lines?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR
 
Posts: n/a
Default How do I make letters not show up in a alpha-numeric string?

ASAP Utilities, a free Add-in available at www.asap-utilities.com has a
feature that will strip out all the alpha characters............

Vaya con Dios,
Chuck, CABGx3



"gdd6936" wrote:

I have data that appears like this: "R1-C2-D1-12". I would like the same data
appear in another column like this: "1-2-1-12". How can I make this happen
without spending hours typing it in, I have several thousand lines?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default How do I make letters not show up in a alpha-numeric string?

Sub RemoveAlphas()
'' Remove alpha characters from a string.
'' except for decimal points and hyphens.
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
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 Fri, 2 Jun 2006 12:01:02 -0700, gdd6936
wrote:

I have data that appears like this: "R1-C2-D1-12". I would like the same data
appear in another column like this: "1-2-1-12". How can I make this happen
without spending hours typing it in, I have several thousand lines?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default How do I make letters not show up in a alpha-numeric string?

On Fri, 2 Jun 2006 12:01:02 -0700, gdd6936
wrote:

I have data that appears like this: "R1-C2-D1-12". I would like the same data
appear in another column like this: "1-2-1-12". How can I make this happen
without spending hours typing it in, I have several thousand lines?


Download and install Longre's free morefunc.xll add-in from
http://xcell05.free.fr

Then (assuming that all the letters will be capital letters), use the formula:

=REGEX.SUBSTITUTE(A1,"[A-Z]")

If there may be non-capitalized letters, then:

=REGEX.SUBSTITUTE(A1,"[A-Za-z]")


--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
count number of letters in a string Wiley Excel Worksheet Functions 3 May 11th 06 06:54 PM
sorting alpha numeric list by first left digit kaduna New Users to Excel 6 January 13th 06 11:10 PM
Summing part of an Alpha Numeric String Arturo Excel Worksheet Functions 2 February 23rd 05 09:59 PM
how do I make make my hyperlinks show the email address they are . Dustin Excel Discussion (Misc queries) 0 January 13th 05 01:39 AM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM


All times are GMT +1. The time now is 04:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"