View Single Post
 
Old 08-11-2019, 06:56 PM
trevorc trevorc is offline Windows 7 32bit Office 2013
Competent Performer
 
Join Date: Jan 2017
Posts: 174
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default referencing relative cell

Hi all,
I'm trying to create an auto mailing system, it mostly works but i need to add a check to see if the recipient has already received the email
when i added the code in red below it halts and says not supported, or with xCell.selection it says type mismatch. Otherwise it works ok without the extra code.
Any help or pointers in the right direction is appreciated.
regards
Trevor





Code:
With oExcelEmailApp
    t = InputBox("Enter cell range of E-mail addresses", "Cell Selection")
    For Each xCell In Range(t)
        If xCell.Value Like "*@*" And xCell.Col + 2 = "No" Then
            If xEmailAddr = "" Then
                xEmailAddr = xCell.Value
            Else
                xEmailAddr = xEmailAddr & " ; " & xCell.Value
            End If
        End If
    Next
 End With
Reply With Quote