PC Review


Reply
Thread Tools Rate Thread

convert to Numer

 
 
bijan
Guest
Posts: n/a
 
      19th Nov 2009
Hi all,
I need a function or sample vba code to convert data with character and
spetial character in column A To Culumn B with just Number:

Column A Column B
-------------------------- --------------------------
ZB0056/87998234/BCS 005687998234
64544/64646646BCS 6454464646646
LM01/636336321 01636336321
83333/77/393939 8333377393939

Thanks in advanced
Bijan

 
Reply With Quote
 
 
 
 
Sam Wilson
Guest
Posts: n/a
 
      19th Nov 2009
Public Function numbers(ByVal str As String) As String

Dim i As Integer
Dim s As String

For i = 1 To Len(str)
s = Mid(str, i, 1)
If IsNumeric(s) Then numbers = numbers & s
Next i

End Function


"bijan" wrote:

> Hi all,
> I need a function or sample vba code to convert data with character and
> spetial character in column A To Culumn B with just Number:
>
> Column A Column B
> -------------------------- --------------------------
> ZB0056/87998234/BCS 005687998234
> 64544/64646646BCS 6454464646646
> LM01/636336321 01636336321
> 83333/77/393939 8333377393939
>
> Thanks in advanced
> Bijan
>

 
Reply With Quote
 
bijan
Guest
Posts: n/a
 
      19th Nov 2009
Thank you Sam,
It works perfect

"Sam Wilson" wrote:

> Public Function numbers(ByVal str As String) As String
>
> Dim i As Integer
> Dim s As String
>
> For i = 1 To Len(str)
> s = Mid(str, i, 1)
> If IsNumeric(s) Then numbers = numbers & s
> Next i
>
> End Function
>
>
> "bijan" wrote:
>
> > Hi all,
> > I need a function or sample vba code to convert data with character and
> > spetial character in column A To Culumn B with just Number:
> >
> > Column A Column B
> > -------------------------- --------------------------
> > ZB0056/87998234/BCS 005687998234
> > 64544/64646646BCS 6454464646646
> > LM01/636336321 01636336321
> > 83333/77/393939 8333377393939
> >
> > Thanks in advanced
> > Bijan
> >

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      19th Nov 2009
If your resulting number will never have more than 14 digits in it, and if
the text string your digits are embedded in will always be less than 300
characters total, then you can use this formula originally posted by
Lars-Åke Aspelin...

=MID(SUMPRODUCT(--MID("01"&A1,SMALL((ROW($1:$300)-1)*ISNUMBER(-MID("01"&A1,ROW($1:$300),1)),ROW($1:$300))+1,1),10^(300-ROW($1:$300))),2,300)

This is an array formula and has to be confirmed with CTRL+SHIFT+ENTER
rather than just ENTER.

--
Rick (MVP - Excel)


"bijan" <(E-Mail Removed)> wrote in message
news:CD2C05EE-8983-4A51-9C32-(E-Mail Removed)...
> Hi all,
> I need a function or sample vba code to convert data with character and
> spetial character in column A To Culumn B with just Number:
>
> Column A Column B
> -------------------------- --------------------------
> ZB0056/87998234/BCS 005687998234
> 64544/64646646BCS 6454464646646
> LM01/636336321 01636336321
> 83333/77/393939 8333377393939
>
> Thanks in advanced
> Bijan
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert string containing numbers and decimal points to the numer =?Utf-8?B?V2F2ZXF1YXRpb24=?= Microsoft Access VBA Modules 1 31st Oct 2007 09:39 PM
numer format Mark Kubicki Microsoft Access Reports 5 2nd Jun 2007 06:35 PM
Numer of recipients =?Utf-8?B?Y29tbXRlYWNoZXI=?= Microsoft Outlook Discussion 1 20th Jan 2007 12:15 PM
Numer Lock stan Microsoft Excel Misc 0 1st Dec 2003 09:35 PM
Numer lock on start-up Donnie Windows XP Customization 1 20th Jul 2003 01:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 AM.