Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
separate two dates from a text string into two separate cells | Excel Discussion (Misc queries) | |||
Identify if a cell contains a numerical string | Excel Worksheet Functions | |||
Count the same numerical occurence in 2 separate columns | Excel Discussion (Misc queries) | |||
Copying Numerical Totals of separate worksheets to a single Summary Worksheet | Setting up and Configuration of Excel | |||
Copying Numerical Totals of separate worksheets to a single Summary Worksheet | Excel Discussion (Misc queries) |