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.
 
I think I am there !

The hyperling is not functional though (does not open outlook?)

Private Sub Workbook_Open()
Dim asd As Variant
Dim dsa As String
Dim filepath As String
filepath = "C:\My Documents\"
asd = "@hotmail.com"
dsa = (Environ$("Username"))
ThisWorkbook.Sheets("Sheet1").Range("H51").Formula = "=HYPERLINK(""" & dsa & asd & """)"
ThisWorkbook.Sheets("Sheet1").Range("L35").Select
With ActiveSheet.Pictures.Insert(filepath & dsa & ".jpg")
.Left = Range("L35").Left
.Top = Range("L35").Top
End With
End Sub
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
sorry didnt ever click it :P

ThisWorkbook.Sheets("Sheet1").Range("H51").Formula = "=HYPERLINK(""" & "mailto:" & dsa & asd & """)"

this works fine now :)
 
Upvote 0
Thanks, Works fine

The cell reference points to L35 when the macro is complete

Can I reset the cell reference to start at my first cell A12 after the Macro runs ?
 
Upvote 0
yeah just change the below again to be what cell you need

ThisWorkbook.Sheets("Sheet1").Range("A12").Select
 
Upvote 0
Now I am getting "really tired".
My Image is sized correctlyand there is no need to position to fit, however but instead of Left Position I want Right Postion on the Cell.
Changed the command below from Left to Right and got

Run-time error '438':
Object does not support Property or Method

Again my logic failed ! any ideas?

Private Sub Workbook_Open()
Dim asd As Variant
Dim dsa As String
Dim filepath As String
filepath = "C:\Documents and Settings\stephen.imrie\"
asd = "@frankcowan.com"
dsa = (Environ$("Username"))
ThisWorkbook.Sheets("Certificate").Range("J60").Formula = "=HYPERLINK(""" & "mailto:" & dsa & asd & """)"
ThisWorkbook.Sheets("Certificate").Range("N57").Select
With ActiveSheet.Pictures.Insert(filepath & dsa & ".jpg")
.Right = Range("L57").Right
.Top = Range("L57").Top
ThisWorkbook.Sheets("Certificate").Range("A12").Select
End With
End Sub
 
Upvote 0
thats because there is no such thing as a right property. you need to work from left or top.

try using .width and .height
 
Upvote 0

Forum statistics

Threads
1,224,620
Messages
6,179,927
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