Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default separate the numerical values in a string


Hi,

I have an excel worksheet that has a column that contains values that
look like this "BD345". I need to extract the numbers by using a macro
since I have about 15000 entries. For example in a cell where the value
is BD345 I want to activate the macro and then get the 345 in the same
cell or in the next one it doesn't mattter as where as long as I get
the numerical value.

I appreciate any help I can get on this. Thank you in advance.

Kind Regards,


--
nebrass
------------------------------------------------------------------------
nebrass's Profile: http://www.excelforum.com/member.php...o&userid=32802
View this thread: http://www.excelforum.com/showthread...hreadid=526220

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default separate the numerical values in a string


Hello I think this link will help - in it is a fantastic tool.
Among many other useful tools, there is a function that removes all
non-numeric characters from a cell or range of cells.


the link - http://www.asap-utilities.com/ - it is free


--
rbanks
------------------------------------------------------------------------
rbanks's Profile: http://www.excelforum.com/member.php...fo&userid=2944
View this thread: http://www.excelforum.com/showthread...hreadid=526220

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default separate the numerical values in a string

On Fri, 24 Mar 2006 15:00:41 -0600, nebrass
wrote:


Hi,

I have an excel worksheet that has a column that contains values that
look like this "BD345". I need to extract the numbers by using a macro
since I have about 15000 entries. For example in a cell where the value
is BD345 I want to activate the macro and then get the 345 in the same
cell or in the next one it doesn't mattter as where as long as I get
the numerical value.

I appreciate any help I can get on this. Thank you in advance.

Kind Regards,



Here's one way to do it with a macro:

==========================
Sub ExtractDigits()
Dim c As Range
Dim n As String
Dim i As Long

For Each c In Selection
n = ""
For i = 1 To Len(c.Text)
If Mid(c.Text, i, 1) Like "#" Then
n = n & Mid(c.Text, i, 1)
End If
Next i
c.Value = Val(n)
Next c

End Sub
=============================
--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
separate two dates from a text string into two separate cells Tacrier Excel Discussion (Misc queries) 3 October 13th 08 08:53 PM
Identify if a cell contains a numerical string Pierre Excel Worksheet Functions 3 January 15th 08 06:58 PM
Count the same numerical occurence in 2 separate columns jr100 Excel Discussion (Misc queries) 5 July 26th 06 03:53 PM
Copying Numerical Totals of separate worksheets to a single Summary Worksheet buster1831 Setting up and Configuration of Excel 1 February 22nd 05 08:07 AM
Copying Numerical Totals of separate worksheets to a single Summary Worksheet buster1831 Excel Discussion (Misc queries) 2 February 16th 05 11:28 PM


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