Hey guys,
I try to find these things before posting to save you guys the work...
I'm still very much a newbie with code, but I've found this code:
Where column A= email address, B= subject and C=body - and it works great.
What do I need to change to have it pull data from a different sheet?
I'm trying to have a macro on sheet 1 email data from sheet 2?
Also what do I need to change if there are multiple cells in column c that I want in the body of the email?
Any help or direction would be greatly appreciated!
I try to find these things before posting to save you guys the work...
I'm still very much a newbie with code, but I've found this code:
Code:
Sub SendEmail()
Dim OutlookApp As Object
Dim MItem As Object
Dim cell As Range
Dim email_ As String
Dim subject_ As String
Dim body_ As String
Dim attach_ As String
'Create Outlook object
Set OutlookApp = CreateObject("Outlook.Application")
' Loop through the rows
For Each cell In Columns("a").Cells.SpecialCells(xlCellTypeConstants)
email_ = cell.Value
subject_ = cell.Offset(0, 1).Value
body_ = cell.Offset(0, 2).Value
'Create Mail Item and send it
Set MItem = OutlookApp.CreateItem(0)
With MItem
.To = email_
.Subject = subject_
.Body = body_
.Send
End With
Next
End Sub
Where column A= email address, B= subject and C=body - and it works great.
What do I need to change to have it pull data from a different sheet?
I'm trying to have a macro on sheet 1 email data from sheet 2?
Also what do I need to change if there are multiple cells in column c that I want in the body of the email?
Any help or direction would be greatly appreciated!