Formula Code

  • Thread starter Thread starter Edgar
  • Start date Start date
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
 
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))"
 
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
 
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.
 
Back
Top