Preventing E-mail messages with blank "To" line
Posted by Lewis (1) on December 20, 2001 1:57 AM
I am using the following to send E-mails.
Dim myFile As String, s As String
myFile = ActiveWorkbook.Name
If Not IsNull(Application.MailSession) Then Application.MailLogon
For Each c In .Range("A18:A20").Cells
s = c.Value
Workbooks(myFile).SendMail Recipients:=s, _
Subject:="Here is a NEW Problem Report", _
What I am trying to do is make it ignore empty cells and not generate a message with a blank "To".
Basically I want to be able to set up an area into which the user can place their list of recipients without having to re-set the range in the macro every time they add or subtract a recipient. I have tried variious ways but always get the message with the blank "To".