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

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.
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
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,185
Members
449,071
Latest member
cdnMech

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