LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,047
Default remove text from cell

hi,

copy this module (ALT+F11) and use a function =digitsonly(a2)

hth
regards from Brazil
Marcelo

************************************************** *
Public Function DigitsOnly(sStr As String) As Variant
Dim oRegExp As Object

Set oRegExp = CreateObject("VBScript.RegExp")

With oRegExp
.IgnoreCase = True
.Global = True
oRegExp.Pattern = "\D"

DigitsOnly = oRegExp.Replace(sStr, vbNullString)
End With
End Function
************************************************



"Sam" escreveu:

I need to remove text from cell and show only numbers
example number 510-889.

Each cell contains different amount of text.

Thanks!!

 
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
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
How do I paste text data into ONE cell only? Pegcorp Excel Discussion (Misc queries) 1 May 10th 06 05:48 PM
remove text from cell containing numbers Tim Excel Discussion (Misc queries) 2 March 22nd 06 02:30 PM
Shade cell according to text? Ltat42a Excel Discussion (Misc queries) 0 January 3rd 06 06:37 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM


All times are GMT +1. The time now is 05:05 PM.

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

About Us

"It's about Microsoft Excel"