Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Remove number from text string

Please how do I remove numbers from unformatted texts strings e.g
DEPOSIT RICA MARINE 6890312 RICA MARINE
or
DEPOSIT 7048783 KURUS NIG
or
DEPOSIT 7042248 NNAJI 7042248 NNAJI
Pls I need a plobal formula for these
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Remove number from text string

On Thu, 20 Mar 2008 04:04:00 -0700, adunao
wrote:

Please how do I remove numbers from unformatted texts strings e.g
DEPOSIT RICA MARINE 6890312 RICA MARINE
or
DEPOSIT 7048783 KURUS NIG
or
DEPOSIT 7042248 NNAJI 7042248 NNAJI
Pls I need a plobal formula for these


This UDF will remove all the digits from a text string, returning only the text
portions.

To enter this, <alt-F11 opens the VBEditor. Ensure your project is
highlighted in the project explorer window, then Insert/Module and paste the
code below into the window that opens.

To use this, enter the formula =RemDigits(cell_ref) into some cell where
cell_ref is your target cell (e.g. A1).

=============================
Option Explicit
Function RemDigits(str As String) As String
Dim re As Object
Set re = CreateObject("vbscript.regexp")
re.Global = True
re.Pattern = "\d+"
RemDigits = re.Replace(str, "")
End Function
==========================
--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
Remove number from text string Mike H Excel Worksheet Functions 0 March 20th 08 10:45 AM
Remove number from string in excel Chris Excel Discussion (Misc queries) 7 June 13th 07 04:16 PM
remove text from string Todd Excel Worksheet Functions 3 May 25th 06 11:10 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 09:56 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 12:25 AM


All times are GMT +1. The time now is 04:36 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"