i am trying to write a macro in excel. the situation is i want to send a follow up mail which is already sent before,the mail is already in my sent items,i need to add up including the first original mail. Is this possible with a macro or VBA in excel? any help is thank full.
thanks in advance. below is the macro where i send a first original mail from excel.now i want to add follow up mail for which i send from this code.
is this possible?
Private Sub Worksheet_Change(ByVal Target As Range) Dim selectedValue As String Dim templateValues As String Dim fileLocation As String Dim personName As String Dim Subject As String
selectedValue = ActiveCell.Formula
On Error GoTo SubEnd templateValues = Application.WorksheetFunction.VLookup(selectedValue, Sheets("Template").Range("A1:A30"), 1, False) fileLocation = Application.WorksheetFunction.VLookup(selectedValue, Sheets("Template").Range("A1:B30"), 2, False) Subject = Application.WorksheetFunction.VLookup(selectedValue, Sheets("Template").Range("A1:C30"), 3, False) personName = Cells(Application.ActiveCell.Row, 6).Value & " " & Cells(Application.ActiveCell.Row, 7).Value
If selectedValue = templateValues Then Call Client_Mails(fileLocation, Subject)
End If SubEnd: End Sub
Sub Client_Mails(fileLocation As String, Subject As String)
thanks in advance. below is the macro where i send a first original mail from excel.now i want to add follow up mail for which i send from this code.
is this possible?
Private Sub Worksheet_Change(ByVal Target As Range) Dim selectedValue As String Dim templateValues As String Dim fileLocation As String Dim personName As String Dim Subject As String
selectedValue = ActiveCell.Formula
On Error GoTo SubEnd templateValues = Application.WorksheetFunction.VLookup(selectedValue, Sheets("Template").Range("A1:A30"), 1, False) fileLocation = Application.WorksheetFunction.VLookup(selectedValue, Sheets("Template").Range("A1:B30"), 2, False) Subject = Application.WorksheetFunction.VLookup(selectedValue, Sheets("Template").Range("A1:C30"), 3, False) personName = Cells(Application.ActiveCell.Row, 6).Value & " " & Cells(Application.ActiveCell.Row, 7).Value
If selectedValue = templateValues Then Call Client_Mails(fileLocation, Subject)
End If SubEnd: End Sub
Sub Client_Mails(fileLocation As String, Subject As String)