Reference a cell in email title

O177812

Board Regular
Joined
Apr 16, 2015
Messages
82
Office Version
  1. 365
  2. 2021
I am usingthe below:

Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
Set rng = Selection.SpecialCells(xlCellTypeVisible)
Set rng = Sheets("BY SKU").Range("B2:F11").SpecialCells(xlCellTypeVisible)
On Error Resume Next
With OutMail
.To = "kremaley@inw-group.com; kristin@proformlabs.com; cory@proformlabs.com; orders@proformlabs.com"
.Cc = "sboatright@proformlabs.com; shippingshared@proformlabs.com; garvizu@inw-group.com"
.Subject = "Walmart Orders: Orders Created " & Format(Now, "mm-dd-yyyy") & " for ship " & Format(Now + 7, "mm-dd-yyyy")
.HTMLBody = "Hi Team, " & Chr(10) & "<br>" & "<br>" & _
Chr(10) & "Here are the orders that came in today that are scheduled to ship on " & Format(Now + 7, "mm-dd-yyyy") & Chr(10) & Chr(10) & RangetoHTML(rng) & "<br>" & _
Chr(10) & "Have a great week!"
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
On Error GoTo 0
Set OutMail = Nothing


I want to replace the highlighted to use a selected cell (Cell C7 on a worksheet titled "BY DC")

Please help :(
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Perhaps ... & Sheets("BY DC").Range("C7") & Chr(10) & Chr(10)
However, not sure if you need to worry about why the cell is selected when you can just refer to it by its address. Or did you mean to use a value from the active/selected cell regardless of which that is?
 
Upvote 0

Forum statistics

Threads
1,215,706
Messages
6,126,336
Members
449,310
Latest member
zztt388

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