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.
 
Thanks,

I was on vacation for the last week. I have now figured out the issues with the path and I am able to insert a jpg file into Sheet 1 .

However the image will not insert into the cell reference L51? it looks to be just positioned as Picture 1 around B5:D7 I am using XP and Excel 2007

The reference cell is a merged cell "unlocked", but it is not being placed anywhere near this reference

Also would I be able to set H51 as a hyperlink to make the email address active or convert it to a mailto: function somehow?

Private Sub Workbook_Open()
Dim asd As Variant
Dim dsa As String
Dim filepath As String
filepath = "C:\Documents and Settings\stephen.scott\"
asd = "@hotmail.com"
dsa = (Environ$("Username"))
ThisWorkbook.Sheets("Sheet1").Range("H51").Value = _
dsa & asd
ThisWorkbook.Sheets("Sheet1").Range("L51").Select
ActiveSheet.Pictures.Insert (filepath & dsa & ".jpg")
End Sub <!-- / message -->
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
welcome back :)

with the picture its hard to insert into a cell. there is examples around using the comments section instead but I cant find them sorry.

Pictures nativatley insert into the sheet :(

with the hyperlink would be

Code:
ThisWorkbook.Sheets("Sheet1").Range("H51").Formula = "=HYPERLINK(""" & dsa& asd& """,""" & "Link" & """)"
"Link" in the above is the name it will show for hyperlink
 
Upvote 0
Thank you again for your valuable assistance

I will look around to see if there are other solutions to inserting the jpg file.

Strange as it works exactly as I need at home using 7 and Excel 2003?

Cheers :biggrin:
 
Upvote 0
I guess I spoke too soon? I know it must be something simple

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& """,""" & "Link" & """)"
dsa & asd
ThisWorkbook.Sheets("Sheet1").Range("L51").Select
ActiveSheet.Pictures.Insert (filepath & dsa & ".jpg")
End Sub
 
Upvote 0
you have dsa and asd below the new code doing nothing:

ThisWorkbook.Sheets("Sheet1").Range("H51").Formula = "=HYPERLINK(""" & dsa& asd& """,""" & "Link" & """)"

dsa & asd ' here is the error delete this

 
Upvote 0
Deleted as shown, still getting a compile error, syntax error
sorry the simple must have been me :eeek:

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& """,""" & "Link" & """)"
ThisWorkbook.Sheets("Sheet1").Range("L51").Select
ActiveSheet.Pictures.Insert (filepath & dsa & ".jpg")
End Sub
 
Upvote 0
simple errors happen all the time. here is the "."

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

should be

Code:
ThisWorkbook.Sheets("Sheet1").Range("H51").Formula = "=HYPERLINK(""" & dsa & asd & """,""" & "Link" & """)"
 
Upvote 0
I found some code which will insert a image from the web and am told it works in 2007, (it worked in 2003), my images are local and would appreciate assistance stitching this code into your code.

pPath = "C:\My Documents\" ?

As much detail as you can would be appreciated :biggrin:


Sub InsPicture()
pPath = "http://chandoo.org/images/pointy-haired-dilbert-excel-charts-tips.png"
With ActiveSheet.Pictures.Insert(pPath)
.Left = Range("L51").Left
.Top = Range("L51").Top
End With
End Sub
 
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