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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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,215,492
Messages
6,125,115
Members
449,206
Latest member
burgsrus

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