i have code to email when an address (several in dropdown list) which is housed in C51, but what i need is for this to only be active or be able to be sent when C50 is populated or at least contain certain text.
would this be possible to do
many thanks
Private Sub CommandButton1_Click()Dim OutApp As Object
Dim OutMail As Object
Dim mess As Object, recip As String
recip = [c51].Value
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.Recipients.Add recip
.CC = ""
.BCC = ""
.Subject = ""
.Body = ""
.Attachments.Add ActiveWorkbook.FullName
.display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
would this be possible to do
many thanks
Private Sub CommandButton1_Click()Dim OutApp As Object
Dim OutMail As Object
Dim mess As Object, recip As String
recip = [c51].Value
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.Recipients.Add recip
.CC = ""
.BCC = ""
.Subject = ""
.Body = ""
.Attachments.Add ActiveWorkbook.FullName
.display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub