+ Reply to Thread
Results 1 to 7 of 7

adding the @whatever.com in a field

  1. #1
    Registered User
    Join Date
    12-21-2005
    Posts
    6

    Lightbulb adding the @whatever.com in a field

    is there a way to write a script that would take the first initial of the first name in the first name field and the whole last name in the last name field and add the @domain.com to it in a different field.

    for example:
    I go to add john for first name in col A and smith for last name in col b and it automatically adds jsmith@domain.com to col E

    is this possible?

  2. #2
    Dave Peterson
    Guest

    Re: adding the @whatever.com in a field

    =left(a1,1)&b1&"@domain.com"
    or
    =left(a1,1)&b1&"@"&c1

    if c1 contained the domain.

    bdepew wrote:
    >
    > is there a way to write a script that would take the first initial of
    > the first name in the first name field and the whole last name in the
    > last name field and add the @domain.com to it in a different field.
    >
    > for example:
    > I go to add john for first name in col A and smith for last name in col
    > b and it automatically adds jsmith@domain.com to col E
    >
    > is this possible?
    >
    > --
    > bdepew
    > ------------------------------------------------------------------------
    > bdepew's Profile: http://www.excelforum.com/member.php...o&userid=29824
    > View this thread: http://www.excelforum.com/showthread...hreadid=497567


    --

    Dave Peterson

  3. #3
    Registered User
    Join Date
    12-21-2005
    Posts
    6

    adding domain

    what if there is no field for domain, its always the same domain.
    thanks for the quick repsonse

  4. #4
    Registered User
    Join Date
    12-21-2005
    Posts
    6

    oh ok

    nm i got it.

    thanks

  5. #5
    Giles
    Guest

    RE: adding the @whatever.com in a field

    If Column A has forename, Column B has surname then copy this into cell E2
    and drag down as far as you want:

    =LEFT(A2,1)&B2&"@domain.com"

    To do this in a macro, copy the following into a standard module:

    Option Explicit
    Sub SetEMailAdd()
    Dim iRow As Integer
    iRow = 2 ' Assumes column header in row 1
    Do While Cells(iRow, 1) <> ""
    Cells(iRow, 5) = Left(Cells(iRow, 1), 1) & Cells(iRow, 2) &
    "@domain.com"
    iRow = iRow + 1
    Loop
    End Sub

    "bdepew" wrote:

    >
    > is there a way to write a script that would take the first initial of
    > the first name in the first name field and the whole last name in the
    > last name field and add the @domain.com to it in a different field.
    >
    > for example:
    > I go to add john for first name in col A and smith for last name in col
    > b and it automatically adds jsmith@domain.com to col E
    >
    > is this possible?
    >
    >
    > --
    > bdepew
    > ------------------------------------------------------------------------
    > bdepew's Profile: http://www.excelforum.com/member.php...o&userid=29824
    > View this thread: http://www.excelforum.com/showthread...hreadid=497567
    >
    >


  6. #6
    Registered User
    Join Date
    12-21-2005
    Posts
    6

    one more thing..

    This would mean i would have to change the formula each time to match each person, 1, 2, 3, 4, 5...etc....
    is there a way it will auto do it....i mean the way the formula is setup now if i put that in row 3 it will take the name from row 1, how can i make it auto pull from the row its on ? or is there?

  7. #7
    Registered User
    Join Date
    12-21-2005
    Posts
    6

    got it

    Thanks Again, Got It!!!
    Perfect

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1