VBA, Excel Email Subject with last row, column B only

Bluesguy07

New Member
Joined
Mar 11, 2016
Messages
28
Hello friends,

I'm trying figure out how to place in the subject, of an email generated through Excel, just what is in column B, last row. I'm having issues with that. Here is my code below, well not all of it... but I believe you should be able to give me what I need. The subject will be "Shipping Request From" and then Last Row, Column B

If you do indeed need more from me, let me know.


With CreateObject("Outlook.Application").CreateItem(0)
.To = ThisWorkbook.Sheets("Sheet3").Range("A2").Value
.Subject = "Shipping Request From"
.HTMLBody = RangetoHTML(rngAttach)
'.Send
.Display



Thanks in advance
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi,

I assume you mean value of the last row in column B in Sheet3? In such case, this should work:

Code:
.Subject = "Shipping Request From" & ThisWorkbook.Sheets("Sheet3").Range("B" & Rows.Count).End(xlUp).Value
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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