Hi Sonal

I hope you realise that if you apply any of the suggested solutions to your
string " rahul;6e3-" you will get "rahule" not "rahul".  I hope this is
what you want.  If not we might need to see a greater selection of strings
to see if there is a pattern (like - always cut them off at the first
 non-letter).

Regards
David Grugeon

On 5 June 2012 01:28, sonal gupta <sonal...@gmail.com> wrote:

> Thanks ashish.I'll try it.
>
> On Monday, June 4, 2012 8:51:06 PM UTC+5:30, ashish wrote:
>>
>> Sub text_clean()
>> Application.DisplayAlerts = False
>> Application.Calculation = xlCalculationManual
>> Dim cell As Range
>> Dim str As String, text1 As String
>> For Each cell In Selection
>> str = ""
>> text1 = ""
>> str = cell.Text
>> For i = 1 To Len(str)
>> If (Asc(Mid(str, i, 1)) > 64 And Asc(Mid(str, i, 1)) < 90) Or
>> (Asc(Mid(str, i, 1)) > 96 And Asc(Mid(str, i, 1)) < 123) Then
>> text1 = text1 & Mid(str, i, 1)
>> End If
>> Next i
>> cell.Value = text1
>> Next
>> Application.DisplayAlerts = True
>> Application.Calculation = xlCalculationAutomatic
>> End Sub
>>
>>
>>
>> On Mon, Jun 4, 2012 at 8:44 PM, sonal gupta <sonal...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> This is my first post in this group.I have learnt many things from this
>>> group.I'm finding difficulty in cleaning the range in which each cell has
>>> string like " rahul;6e3-".I need a macro which will clean the special
>>> characters,spaces & numbers & leave the alphabets only.
>>>
>>> Thanks in advance.
>>>
>>> --
>>> FORUM RULES (986+ 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.
>>>
>>> NOTE : Don't ever post personal or confidential data in a workbook.
>>> Forum owners and members are not responsible for any loss.
>>>
>>> ------------------------------**------------------------------**
>>> ------------------------------**------------
>>> To post to this group, send email to excel-macros@googlegroups.com
>>>
>>> To unsubscribe, send a blank email to excel-macros+unsubscribe@**
>>> googlegroups.com <excel-macros%2bunsubscr...@googlegroups.com>
>>
>>
>>
>>
>> --
>> *Regards*
>> * *
>> *Ashish Koul*
>> *http://www.excelvbamacros.com/*
>> *http://www.accessvbamacros.com/* <http://www.accessvbamacros.com/>
>>
>>
>> P Before printing, think about the environment.
>>
>>
>>  --
> FORUM RULES (986+ 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.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>
> To unsubscribe, send a blank email to
> excel-macros+unsubscr...@googlegroups.com
>



-- 
David Grugeon

-- 
FORUM RULES (986+ 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. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com

Reply via email to