Hi everyone, i found this code on the rondebruin website and I'm trying to make it work better for my application. This code works great, it sends all the rows in seperate emails, but the problem is- this email is being sent to a phone as a text message. I need it to display the body of the email on the top line of every email, right now, if it determines that it needs to send out 10 messages, they all go out individually but the position of the body of the email will move down as the macro moves down in the list, this prevents the message being seen when the text arrives because the screen is so small. So how do I hide the row that it just emailed before it goes to the next email?
With Sheets("SendRow")
Set OutApp = CreateObject("Outlook.Application")
For Each cell In .Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And LCase(cell.Offset(0, 1).Value) = "yes" Then
.Range("A1:O100").AutoFilter Field:=2, Criteria1:=cell.Value
Set rng = .AutoFilter.Range.SpecialCells(xlCellTypeVisible)
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = cell.Value
.Subject = "Hourly Rounding"
.HTMLBody = RangetoHTML(rng)
.Send
End With
Set OutMail = Nothing
.AutoFilterMode = False
End If
Next cell
cleanup:
Set OutApp = Nothing
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
.Protect
End With
Sheets("Update").Select
End Sub
Bookmarks