LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Please help with removing text string

Paste this code into a Standard Module of your Workbook:

Public Function GetNumPart(c) As String
Dim i As Integer
Dim MyString As String

'Returning numeric value from string'
MyString = ""
For i = 1 To Len(c)
If InStr(1, "0123456789", Mid(c, i, 1), vbTextCompare) 0 Then
MyString = MyString + Mid(c, i, 1)
End If
Next i
GetNumPart = MyString
End Function

Then at a sheet
Example, if in cell A1 you had: Zorgia [NBK-R] (-89,113) Defending
In B1 enter =GetNumPart(A1)

B1 will (should) produce 89113



"excelator" wrote:


For example I have data MK12345 and would like to remove the text from
that so I only have the numerica value return.

What VBA code do I use?

PS: Is there a list somehwere which will list description of all the
functions available?


Thank you!


--
excelator
------------------------------------------------------------------------
excelator's Profile: http://www.excelforum.com/member.php...o&userid=37504
View this thread: http://www.excelforum.com/showthread...hreadid=571567


 
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
Find & Replace text format jmn13 Excel Discussion (Misc queries) 2 May 25th 06 06:18 PM
Finding specific text in a string Hardip Excel Worksheet Functions 5 April 8th 06 01:16 PM
Text string and sum michaelp Excel Worksheet Functions 4 November 14th 05 09:49 PM
Remove last character of text string Grant Excel Worksheet Functions 2 September 29th 05 05:17 PM
dynamic cell reference within a text string gvm Excel Worksheet Functions 4 July 25th 05 02:40 AM


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