ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to separate user name and domain name in email id? (https://www.excelbanter.com/excel-discussion-misc-queries/221247-how-separate-user-name-domain-name-email-id.html)

Harshad[_2_]

How to separate user name and domain name in email id?
 
I have many mail ids in excell sheet in column A. I want to separate the
username and domain name in Column B and Column C respectively. e.g. Column
A: , Column B: abcde and Column C: gmail.com


thanks in advance

Harshad

mesuttasar

How to separate user name and domain name in email id?
 

Harshad;233734 Wrote:
I have many mail ids in excell sheet in column A. I want to separate
the
username and domain name in Column B and Column C respectively. e.g.
Column
A: , Column B: abcde and Column C: gmail.com


thanks in advance

Harshad


Hi this is my first post , please try that code.


Code:
--------------------

Sub soyad_ayir()
Columns("B:C").ClearContents
For i = 1 To Cells(65536, 1).End(xlUp).Row
a = Split(Cells(i, 1), "@")
For j = 0 To UBound(a) - 1
Cells(i, 2) = Trim(Cells(i, 2) & " " & a(j))
Next j
Cells(i, 3) = Trim(a(UBound(a)))
Next i
End Sub

--------------------


--
mesuttasar
------------------------------------------------------------------------
mesuttasar's Profile:
http://www.thecodecage.com/forumz/member.php?userid=133
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=65249


joeu2004

How to separate user name and domain name in email id?
 
On Feb 16, 11:00*pm, Harshad wrote:
I have many mail ids in excell sheet in column A.
I want to separate the username and domain name in
Column B and Column C respectively. e.g. Column
A: , Column B: abcde and Column C:
gmail.com


Several ways to do this. One way ....

If A1 is text of the form "username@domainname", then:

B1: =left(A1,find("@",A1)-1)

C1: =substitute(A1,B1&"@","")

Pecoflyer[_176_]

How to separate user name and domain name in email id?
 

Harshad;233734 Wrote:
I have many mail ids in excell sheet in column A. I want to separate
the
username and domain name in Column B and Column C respectively. e.g.
Column
A: , Column B: abcde and Column C: gmail.com


thanks in advance

Harshad


Try Data-Text to columns - Check " delimited" enter @ as delimiter - OK


--
Pecoflyer

Cheers -
*'Membership is free' (
http://www.thecodecage.com)* & allows file
upload -faster and better answers

*Adding your XL version* to your post helps finding solution faster
------------------------------------------------------------------------
Pecoflyer's Profile: http://www.thecodecage.com/forumz/member.php?userid=14
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=65249


Harshad[_2_]

How to separate user name and domain name in email id?
 
Dear all,

All of your attampt is working very nicely.

Thanks

Harshad

"Pecoflyer" wrote:


Harshad;233734 Wrote:
I have many mail ids in excell sheet in column A. I want to separate
the
username and domain name in Column B and Column C respectively. e.g.
Column
A: , Column B: abcde and Column C: gmail.com


thanks in advance

Harshad


Try Data-Text to columns - Check " delimited" enter @ as delimiter - OK


--
Pecoflyer

Cheers -
*'Membership is free' (
http://www.thecodecage.com)* & allows file
upload -faster and better answers

*Adding your XL version* to your post helps finding solution faster
------------------------------------------------------------------------
Pecoflyer's Profile: http://www.thecodecage.com/forumz/member.php?userid=14
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=65249




All times are GMT +1. The time now is 08:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com