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
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,456
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,128
Messages
5,857,533
Members
431,884
Latest member
Gcmoore63

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
Top