Lookup function to find email addresses

  • Thread starter Thread starter Michael McClellan
  • Start date Start date
M

Michael McClellan

Anybody know why the lookup line of this code does not function
properly?

'Enter order electronically with vendors
Dim VendAddr As String
VendAddr = Range("LOOKUP(INDEX(Orders!$F$1:$L$37,7,1),'Address
Lookup Table'!A$1:A$50,'Address Lookup Table'!F$1:F$50)").Value

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = VendAddr
.CC = ""
.BCC = ""
.Subject = "ORDER from HM: " & HMoffice & HMPO
.Body = "Please enter the following order and utilize the
attached packing list." & vbNewLine & _
"Please confirm receipt of order within 24 hours."
'.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
 
Hi
this line
VendAddr = Range("LOOKUP(INDEX(Orders!$F$1:$L$37,7,1),'Address
Lookup Table'!A$1:A$50,'Address Lookup Table'!F$1:F$50)").Value

can't work. What are you trying to do?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top