+ Reply to Thread
Results 1 to 10 of 10

How to generate email address from names by 1-replacing local letters and 2-adding ".@..."

  1. #1
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Question How to generate email address from names by 1-replacing local letters and 2-adding ".@..."

    Hello,
    I want to create a vba code with would have three missions:
    1) Replace local characters into english letters. I keep these characters in A1:B6 such as replace A1 to B1, A2 to B2 etc. (I cant write replace(name, "İ", "I") because excel doesn't recognize local letters but I can use excel cells to replace)
    ǻC
    ݻI
    лG
    Ö»O
    ޻S
    ܻU

    2) small all characters and get rid of spaces.
    3) add this to the end: "[email protected]"

    examples:
    C columns to D columns
    ÖMER ŞİMŞİRÇİ » [email protected]
    OĞUZ ÇÖP KÜLLÜĞ » [email protected]

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,640

    Re: How to generate email address from names by 1-replacing local letters and 2-adding ".@

    Are the local characters added manually or imported from another file?

  3. #3
    Valued Forum Contributor
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (24 H2) 64 Bit
    Posts
    1,187

    Re: How to generate email address from names by 1-replacing local letters and 2-adding ".@

    If the names are in cells starting from A1 to down .... the below code will generate the e-mail addresses as your request.

    Please Login or Register  to view this content.
    Last edited by Haluk; 03-02-2020 at 05:35 AM.

  4. #4
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Re: How to generate email address from names by 1-replacing local letters and 2-adding ".@

    Haluk Bey,
    Thank you for your simple and shortcut solution. It works great. Could you tell me the secret of 64?
    It works great.

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,640

    Re: How to generate email address from names by 1-replacing local letters and 2-adding ".@

    Excuse my ignorance but how does that macro satisfy the two first requirements?
    Replace local characters into english letters. I keep these characters in A1:B6 such as replace A1 to B1, A2 to B2 etc. (I cant write replace(name, "İ", "I") because excel doesn't recognize local letters but I can use excel cells to replace)
    ǻC
    ݻI
    лG
    Ö»O
    ޻S
    ܻU

    2) get rid of spaces.

  6. #6
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Re: How to generate email address from names by 1-replacing local letters and 2-adding ".@

    " ", "" this part removes the spaces but I couldn't understand how the formula transforms local characters into English characters and I guess 64 makes that magic somehow. Maybe it removes dots from the local characters.

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,521

    Re: How to generate email address from names by 1-replacing local letters and 2-adding ".@

    64 is the numeric value of vbUnicode in the strConv-function.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  8. #8
    Valued Forum Contributor
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (24 H2) 64 Bit
    Posts
    1,187

    Re: How to generate email address from names by 1-replacing local letters and 2-adding ".@

    Problem of converting some of the Turkish characters to nearest readable ASCII character is always discussed in our local Turkish Excel forums.

    The solution I suggested in message #3 was proposed by me 2 years ago, which can be seen from the link below...


    https://www.excel.web.tr/threads/nok...17/post-952691


    As you know, "StrConv" function's parameters are;

    Please Login or Register  to view this content.
    where, LCID stands for "Local ID" for language/country settings. Values that can be used are listed in the link below;

    https://analystcave.com/vba-referenc...onv-function/#


    When I attemted to use this function to solve the problem, I started playing around to find a suitable LCID and found that, some of them were giving good results.

    Such as; (Ukrainian - 1058) or (Tajik - 1064)

    Then, I just tried some values that are not listed in the LCID table to see what's going on. Most of them ended with an error message as expected but some of them did not throw any errors but the results were not suitable. Such as using; 98 or 32 ... Thus, I thought that if a value not listed in the LCID table does not give an error but returns an unsatisfactory result, then there may be a value which doesn't give an error, returning a satisfactory result.

    At the end, I found the "magic" number 64 by trial-and-error. May be I could have found some more values also but I don't remember as it was 2 years ago.

    This is the story of the code on my end ...

    .
    Last edited by Haluk; 03-03-2020 at 01:22 PM.

  9. #9
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Re: How to generate email address from names by 1-replacing local letters and 2-adding ".@

    I'm very lucky that you saw my question and I learnt something new from you. Cool story
    I also thank to the others who attempt to help, for your time and interest.

  10. #10
    Valued Forum Contributor
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (24 H2) 64 Bit
    Posts
    1,187

    Re: How to generate email address from names by 1-replacing local letters and 2-adding ".@

    You're welcome (rica ederim).

    .

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Email used range on different sheet, use lookup to populate "to" email address
    By carlito2002wgn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2019, 01:27 PM
  2. [SOLVED] vba email send from excel - ignore second email address if "ENTER EMAIL ADDRESS"
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2016, 07:22 AM
  3. [SOLVED] Adding URL's to existing text "http://web" and not have it link to local files.
    By 20GT in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-17-2016, 11:07 PM
  4. Changing "From" Email address based upon "To"
    By Muhammad Atif Gul in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 03-20-2014, 02:57 AM
  5. Replies: 1
    Last Post: 05-23-2013, 02:04 PM
  6. Email workbook to email address in cell "a1" macro
    By klawlor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2013, 09:20 AM
  7. Adding commas "," in email addresses for sending BULK Email stored cellwise..!
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2011, 09:50 AM

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