ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Look up code (https://www.excelbanter.com/excel-programming/341717-help-look-up-code.html)

Tempy

Help with Look up code
 
Hi all, i got this code from this sit and need to change it to look at a
specific workbook and have tried different ways but keep getting errors;
PLEASE HELP !!!

EmailAddr = Application.Index(Worksheets("SupplierList").Range ("M:M"), _
Application.Match(mySuppNum,
Worksheets("SupplierList").Range("A:A"), 0))

I need it to look for mySuppNum in the workbook "Recon_Master" where the
worksheet ("SupplierList") is resident and then look up the e-mail
address in column M.


Thanks in advance.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***

Tom Ogilvy

Help with Look up code
 
With Workbooks("Recon_Master").Worksheets("SupplierList ")
EmailAddr = Application.Index(.Range("M:M"), _
Application.Match(mySuppNum,.Range("A:A"), 0))
End With

--
Regards,
Tom Ogilvy


"Tempy" wrote in message
...
Hi all, i got this code from this sit and need to change it to look at a
specific workbook and have tried different ways but keep getting errors;
PLEASE HELP !!!

EmailAddr = Application.Index(Worksheets("SupplierList").Range ("M:M"), _
Application.Match(mySuppNum,
Worksheets("SupplierList").Range("A:A"), 0))

I need it to look for mySuppNum in the workbook "Recon_Master" where the
worksheet ("SupplierList") is resident and then look up the e-mail
address in column M.


Thanks in advance.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***




Tempy

Help with Look up code
 
Thanks for your patience & help Tom, I am getting there even if it is
slowly.

Best regards,

Les Stout



*** Sent via Developersdex http://www.developersdex.com ***

Tempy

Help with Look up code
 
Hi Tom, just tried that code and i get an an error message ?
< Subscript out of Range



Tempy

*** Sent via Developersdex http://www.developersdex.com ***

Tom Ogilvy

Help with Look up code
 
My typo. I could have sworn I put in the .xls

With Workbooks("Recon_Master.xls").Worksheets("Supplier List")
EmailAddr = Application.Index(.Range("M:M"), _
Application.Match(mySuppNum,.Range("A:A"), 0))
End With


If that doesn't fix it, then you don't have a sheet named SupplierList in
Recon_Master.xls

--
Regards,
Tom Ogilvy


"Tempy" wrote in message
...
Hi Tom, just tried that code and i get an an error message ?
< Subscript out of Range



Tempy

*** Sent via Developersdex http://www.developersdex.com ***




Tempy

Help with Look up code
 
Thanks Tom, i should have seen that as well !!

best regards,

Les Stout


*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 07:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com