Formula Code

E

Edgar

Hi

I am trying to input the following formula into cell "B3"
but it is coming up with an error. Does anyone know what I
am doing wrong?

Range("B3").Formula = "=IF(ISERROR(VLOOKUP
(A2,'S:\Kingston\FA\Overseas Payments\Overseas Payments
Public\Remittance\Long Haul\Tropical\Tropical Emails.xls'!
Email_List,2,0)),"",VLOOKUP(A2,'S:\Kingston\FA\Overseas
Payments\Overseas Payments Public\Remittance\Long
Haul\Austravel\Austravel Emails.xls'!Email_List,2,0))"

TIA
 
F

Frank Kabel

Hi Edgar
try
Range("B3").Formula = "=IF(ISERROR(VLOOKUP
(A2,'S:\Kingston\FA\Overseas Payments\Overseas Payments
Public\Remittance\Long Haul\Tropical\Tropical Emails.xls'!
Email_List,2,0)),"""",VLOOKUP(A2,'S:\Kingston\FA\Overseas
Payments\Overseas Payments Public\Remittance\Long
Haul\Austravel\Austravel Emails.xls'!Email_List,2,0))"
 
T

TS

I think you'll have to check the number of " in

Email_List,2,0)),"",VLOOKUP

I think it should be
Email_List,2,0)),"""",VLOOKUP
 
T

Tom Ogilvy

The main problem is the embedded double quotes in the string. Rather than
"" you should have """"

within a string, two adjacent double quotes produces 1 double quote in the
output. Since you want two, you need four.
 

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

Similar Threads

Error with For Next 1
Closing workbook 4
Subscript out of range 1
If Problem 8
Importing data 3
Copying to new workbook 1
Merging Documents 3
Import Wizard 1

Top