A common question on this board with a twist

jamesmarcos75

New Member
Joined
Sep 23, 2006
Messages
2
I have set up button in excel that automatically attaches the file to an e-mail and fills out the TO: and SUBJECT: fields. The code is as follows:


Private Sub ClickHereCore_Click()
Application.Dialogs(xlDialogSendMail).Show _
arg1:=Array("name@yahoo.com", "name2@yahoo.com"), _
arg2:="Subject Text"
End Sub

Does anyone no how to amend this code to have the code pull certain text in Cell A1 of the Sheet 1 into the subject field?

Thanks in advance!

Jim
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
Hello jamesmarcos75, welcome to the board.
Assuming you mean to use the value of A1 from the active sheet you can simply replace
the line:
arg2:="Subject Text"
with:
arg2:=[A1].Value

Otherwise you'll want to specify the sheet by name...
arg2:=Sheets("Sheet1").[A1].Value
 

Watch MrExcel Video

Forum statistics

Threads
1,113,777
Messages
5,544,174
Members
410,596
Latest member
JoeyZ
Top