VBA sends mail autofill Subject

helpexcel

Well-known Member
Joined
Oct 21, 2009
Messages
656
Hi,

I have code that will automatically send and email of the spreadsheet that is open. The subject is populated using .Subject = "ABC File"
Is there a way to add in the contents of cell A11 to the subject line? I thought it would as simple as .Subject = "ABC File" & Range("A11") but that doesn't work. I tried a couple of other variations to no avail, so any help is appreciated.

Thanks.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
try...

Code:
.Subject = "ABC File" & Range("A11").value
 
Upvote 0
Hi,

I have code that will automatically send and email of the spreadsheet that is open. The subject is populated using .Subject = "ABC File"
Is there a way to add in the contents of cell A11 to the subject line? I thought it would as simple as .Subject = "ABC File" & Range("A11") but that doesn't work. I tried a couple of other variations to no avail, so any help is appreciated.

Thanks.


Try
.Subject = "ABC File" & worksheets("abc").Cells(11,1)
change the sheet name
 
Upvote 0
@redspanna user error, it is working now. I did let it run through the full cycle before testing, so it was pulling blanks.

@faizankhan Thanks!!!
 
Upvote 0

Forum statistics

Threads
1,203,081
Messages
6,053,415
Members
444,662
Latest member
AaronPMH

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