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.
Bookmarks