Hi All,
First of all i would like to thank you for your support.
the help i need is with the following:
I have an excel sheet that contains a couple of colums. The two import ones are Column A and G
Column A contains cells with Names
Column G contains cells with yes/no
what i need is the following.
IF cell in column G contains "yes" (for a range of rows) then copy the cell in Column A on the same row to a different sheet called renew. or even better that it will send the name in the cell at Column A by email.
i have the code that will send me an email (just email) for each cell that contains "yes" i just need to know the second part how to add the name in Column A to the email.
thanks
this is the code
thanks again
Jonathan
First of all i would like to thank you for your support.
the help i need is with the following:
I have an excel sheet that contains a couple of colums. The two import ones are Column A and G
Column A contains cells with Names
Column G contains cells with yes/no
what i need is the following.
IF cell in column G contains "yes" (for a range of rows) then copy the cell in Column A on the same row to a different sheet called renew. or even better that it will send the name in the cell at Column A by email.
i have the code that will send me an email (just email) for each cell that contains "yes" i just need to know the second part how to add the name in Column A to the email.
thanks
this is the code
Rich (BB code):
Sub message()
Dim OutApp As Object
Dim OutMail As Object
Dim body As String
For Each c In Worksheets("Renewal").Range("G5:G7").Cells
If c.Value = "yes" Then
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "jkessous@gmail.com"
.CC = ""
.BCC = ""
.Subject = "Renewal required"
.body = "Hi there"
' .Attachments.Add Dest.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
End If
Next
End Sub
thanks again
Jonathan