Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Sam Sam is offline
external usenet poster
 
Posts: 699
Default remove text from cell

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

Each cell contains different amount of text.

Thanks!!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 138
Default remove text from cell

Can you provide more information Sam? Whilst the string length varies
do the numbers always come at the front or the end or do they appear
somwhere in the middle?

Is the format of the numbers always the same 123-456?

Do the numbers appear as a single substring or are they spread
throughout your text?

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

Each cell contains different amount of text.

Thanks!!


  #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!!

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
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 02:54 PM.

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"