You can extract number only form a string without vba,

 

Anyway ,here is a VBA code to extract NUMBER,TEXT,SPECIAL CHR from a string

 

= RemoveContents(StringToReplace, 1)   ' To Remove Text

= RemoveContents(StringToReplace, 2)  ' To Remove Number

= RemoveContents(StringToReplace, 3)  ' To Remove Special Characters

 

 

 

Function RemoveContents(StringToReplace, WhatRemove As Long) As String

 

Dim RegEx As Object

Set RegEx = CreateObject("VBScript.RegExp")

 

With RegEx

.Global = True

Select Case WhatRemove

Case 1

.Pattern = "[a-z]"

Case 2

.Pattern = "\d"

Case 3

.Pattern = "[\;+\.+\#+\!+\'+\*+\,+\+\^+\&+\*+\@+\(+\)]"

End Select

End With

RemoveContents = RegEx.Replace(StringToReplace, "")

End Function

 

 

Regards

Rajan verma

+91 7838100659 [IM-Gtalk]

 

From: [email protected] [mailto:[email protected]]
On Behalf Of ???? ?????? ???? 
Sent: 23 October 2012 12:14
To: [email protected]; [email protected]
Subject: Re: $$Excel-Macros$$ Re: Text need in different collume

 

Dear Manoj,

Pl find enclosed the attachment.

 

Regards,



 

On Tue, Oct 23, 2012 at 11:18 AM, Manoj Kumar <[email protected]> wrote:

Dear Expert,

 

I have data witch has Text and Number i want to do saperate text and number
in next collume.

 


man25oj


kuma112r


ro444ha25n


25s26on7

 

 

 

Regard

Manoj

 

-- 
Join official facebook page of this forum @
https://www.facebook.com/discussexcel
 
FORUM RULES (1120+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
6) Jobs posting is not allowed.
 
7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups
"MS EXCEL AND VBA MACROS" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected]
<mailto:excel-macros%[email protected]> .
 
 




-- 
Thanks & Regards,
Gawli Anil Narayan
Software Developer,
Abacus Software Services Pvt Ltd

-- 
Join official facebook page of this forum @
https://www.facebook.com/discussexcel
 
FORUM RULES (1120+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
6) Jobs posting is not allowed.
 
7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups
"MS EXCEL AND VBA MACROS" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
 
 

-- 
Join official facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES (1120+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

6) Jobs posting is not allowed.

7) Sharing copyrighted ebooks/pirated ebooks/their links is not allowed.

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].


Reply via email to