The Vlookup fonction I am using works well on spreadheet.
How can I use the value found by my Vlookup in VB (result will be like: Someone@someISP.com) to remember that value which I do not need copied on any cell, and use it as my recipient in my ELSEIF condition.
This is the script which basically sends an email to Vendor or to Buyer if Vendor address is not found.
'Find which Email belongs to what vendor
j = 1
Do
EmailVendorNo = EmailList.Sheets("list"
.Range("A" + CStr(j)).Value
If (EmailVendorNo = CurrentVendorNo) Then
Recipient = EmailList.Sheets("list"
.Range("f" + CStr(j)).Value
Subject = "Aged Report"
ElseIf EmailVendorNo = "" Then
Recipient = "=VLOOKUP(r5c1,'[VendorEmailAddresses(michel's copy).xls]Buyers'!R2C1:R19C2,2,FALSE)"
Subject = "Failed Report, Vendor not found in email list"
End If
j = j + 1
Loop Until EmailVendorNo = CurrentVendorNo Or EmailVendorNo = ""
Thanks for any help.
How can I use the value found by my Vlookup in VB (result will be like: Someone@someISP.com) to remember that value which I do not need copied on any cell, and use it as my recipient in my ELSEIF condition.
This is the script which basically sends an email to Vendor or to Buyer if Vendor address is not found.
'Find which Email belongs to what vendor
j = 1
Do
EmailVendorNo = EmailList.Sheets("list"
If (EmailVendorNo = CurrentVendorNo) Then
Recipient = EmailList.Sheets("list"
Subject = "Aged Report"
ElseIf EmailVendorNo = "" Then
Recipient = "=VLOOKUP(r5c1,'[VendorEmailAddresses(michel's copy).xls]Buyers'!R2C1:R19C2,2,FALSE)"
Subject = "Failed Report, Vendor not found in email list"
End If
j = j + 1
Loop Until EmailVendorNo = CurrentVendorNo Or EmailVendorNo = ""
Thanks for any help.