inserting user email address

stephenscott

New Member
Joined
Mar 19, 2008
Messages
29
I have a excel template and am looking to insert the individual users email into a cell automatically.

Is there a user profile within windows or excel where I can capture the specific address or

Do I need to setup a sheet with all user names and email addresses?, if so how do I connect that list with the specific user to automatically populate the field?

Any advice would be much appreciated.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I have a excel template and am looking to insert the individual users email into a cell automatically.

Is there a user profile within windows or excel where I can capture the specific address or

Do I need to setup a sheet with all user names and email addresses?, if so how do I connect that list with the specific user to automatically populate the field?

Any advice would be much appreciated.


(Environ$("Username")) will return the windows username for you. can then add @example.com.au to end if all the same company
 
Upvote 0
Thanks If the additional information is constant ie Username@hotmail.com can you show me the script to add this ?

Sure. Depends what you need and how we are getting there. But for example under workbook open section could put


Dim asd as variant

asd = "@hotmail.com"

Thisworkbook.sheets("Sheet1").range("a1").value = _
(Environ$("Username")) & asd



And that's it. Cell a1 on sheet1 will have username@hotmail.com in it

Cheers
 
Upvote 0
Thank you !

Could I expand this with vlookup or match that is username = asd then populate asd's jpeg signature in another cell?
 
Upvote 0
I am looking to populate the username's jpeg (signature) based on their individual variable.

Do I need to define each username first ie
username = stephen
username = scott
username = brenda
 
Upvote 0
I am looking to populate the username's jpeg (signature) based on their individual variable.

Do I need to define each username first ie
username = stephen
username = scott
username = brenda

Is this going to be on a form or in worksheet?
You can save the image as username.jpeg somewhere. One for each person. Then use the asd from above in finding it.

"C:\" & asd & ".jpeg" etc

If you want more detail pm me with a more detailed plan of what you want to do :)
 
Upvote 0
Re: inserting user email address in a template

Thanks

I have a excel templete which is opened by multiple users on my team
The template requires that they fill in their email address (constant ie @hotmail.com) in cell "H51" and insert a jpeg image (signature) into a specific cell "G54" within the template.

Dim asd as variant

asd = "@hotmail.com"

Thisworkbook.sheets("Sheet1").range("H51").value = _
(Environ$("Username")) & asd

I have a list of Usernames which I can identify in the worksheet
ie
username = stephena
username = scottb
username = brendac

I have a list of jpeg images located in my C:\Signatures Folder called the same ie stephena.jpeg, scottb.jpeg, brendac.jpeg

I would like to use vlookup or match the username and populate the image file into the appropriate cell "G54" from the C:\Signatures Folder.

I have sized these images already so I do not beleive I need to do anything further?

Ideally I am looking for some code to lookup the username and populate the image.

Hopefully this provides you with the full detail of what I am looking for.

Thank you again for your assistance.:biggrin:
 
Upvote 0
Re: inserting user email address in a template

Thanks

I have a excel templete which is opened by multiple users on my team
The template requires that they fill in their email address (constant ie @hotmail.com) in cell "H51" and insert a jpeg image (signature) into a specific cell "G54" within the template.

Dim asd as variant

asd = "@hotmail.com"

Thisworkbook.sheets("Sheet1").range("H51").value = _
(Environ$("Username")) & asd

I have a list of Usernames which I can identify in the worksheet
ie
username = stephena
username = scottb
username = brendac

I have a list of jpeg images located in my C:\Signatures Folder called the same ie stephena.jpeg, scottb.jpeg, brendac.jpeg

I would like to use vlookup or match the username and populate the image file into the appropriate cell "G54" from the C:\Signatures Folder.

I have sized these images already so I do not beleive I need to do anything further?

Ideally I am looking for some code to lookup the username and populate the image.

Hopefully this provides you with the full detail of what I am looking for.

Thank you again for your assistance.:biggrin:

ok lets try

Dim asd as variant
dim dsa as string
dim filepath as string

filepath = "C:\Signatures Folder\"
asd = "@hotmail.com"
dsa = (Environ$("Username"))

Thisworkbook.sheets("Sheet1").range("H51").value = _
dsa & asd

thisworkbook.sheets("Sheet1").Range("G54").Pictures.Insert _
(filepath & dsa & ".jpeg") 'if this doesnt work remove brackets
 
Upvote 0
This is exactly what I have but I am getting Runtime error 438 Object doesn't
support this property or method
Username is Stephen and I have a stephen.jpeg file in C:


Private Sub Workbook_Open()
Dim asd As Variant
Dim dsa As String
Dim filepath As String
filepath = "C:\"
asd = "@hotmail.com"
dsa = (Environ$("Username"))
ThisWorkbook.Sheets("Sheet1").Range("H51").Value = _
dsa & asd
ThisWorkbook.Sheets("Sheet1").Range("G54").Pictures.Insert _
filepath & dsa & ".jpeg" 'if this doesnt work remove brackets
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,911
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top