Results 1 to 8 of 8

Custom function to return username part of outlook emails

Threaded View

  1. #1
    Registered User
    Join Date
    04-27-2022
    Location
    New York, USA
    MS-Off Ver
    Office 365 Apps for Enterprise
    Posts
    9

    Question Custom function to return username part of outlook emails

    This is part of a bigger project I'm working on to help automate finding the first & last names of users in my Outlook global address book. I found and attempted to follow an article for retrieving Outlook address book data from Excel using a custom function to pull the username and return First Name, Last Name, etc.

    But that code seems to assume that the cell value is already just the alias/username. So I have 145 cells of full email addresses I need to pull the usernames from, then attempt to use the code I found in that article to pull the Outlook information.

    I'd paste screenshots, but apparently I can't because I'm still new (also it keeps flagging the example email as a link argh), so here's a small example what I need it to do, starting with only the full email.

    Full Email Username First Name Last Name
    usrnme1[at]email-dot-com usrnme1 User1 Name1
    usrnme2[at]email-dot-com usrnme2 User2 Name2
    usrnme3[at]email-dot-com usrnme3 User3 Name3
    usrnme4[at]email-dot-com usrnme4 User4 Name4
    usrnme5[at]email-dot-com usrnme5 User5 Name5
    usrnme6[at]email-dot-com usrnme6 User6 Name6
    usrnme7[at]email-dot-com usrnme7 User7 Name7
    usrnme8[at]email-dot-com usrnme8 User8 Name8
    usrnme9at]email-dot-com usrnme9 User9 Name9


    FOR CONTEXT:
    I'm having to subtract the last "[at]email-dot-com" part because the first half "usrnme" part is not the same amount of characters across all of the emails (unfortunately).

    THE ACTUAL QUESTION:
    I'm not sure what I'm doing wrong in being able to call the function in the B2 cell to make the cell value just that "usrme" part that it pulls from A2 and so forth. I'm trying to test it solo so I know it works before merging it with the other part I found.

    I'm pretty sure I could do this, especially the last "calling it" part, by defining a range and everything...? But I feel that limits the potential of this. If it's possible I'd like to use this across multiple workbooks in the future, in the same way. Either being able to run it in individual cells (which does seem still sort of tedious), or running it as its own macro across entire Worksheets/Workbooks.

    EXCEL VERSION:
    I'm using Excel as part of Office 365 Apps for Enterprise, Ver 2206, on Windows 10 as the desktop app. Example book should be attached.
    Attached Files Attached Files
    Last edited by Faru298; 07-12-2022 at 11:59 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 09-22-2020, 10:57 AM
  2. Send emails in Outlook with custom PDF attachment using Excel and word
    By malek_ali7sas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2020, 08:08 AM
  3. [SOLVED] Macro to Draft Outlook Emails and Attach files in Emails
    By arun.sj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-17-2020, 05:48 AM
  4. Function to return and input an email address from username/details?
    By ZEROCOOL UK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2019, 11:28 AM
  5. Add Checkboxes that will return emails addresses in the BCC field into Outlook
    By j7house in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2017, 02:09 AM
  6. [SOLVED] Sending Outlook emails from Excel; Limits to three emails only?
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2013, 06:53 AM
  7. Send outlook emails with message in cells to individual emails associated with them
    By abinayan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2011, 06:11 AM

Tags for this Thread

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