Solved

IFERROR(VLOOKUP

Posted on 2016-11-01
6
29 Views
Last Modified: 2016-11-01
Hi,

This looks like it should work but doesn't.

   ActiveCell.Formula = "=(IFERROR(VLOOKUP(N2,Sheet3!$A:$B,2,FALSE),"")"

I'm using Excel 2013 and hours of googling says this should work.

Edit: The VLOOKUP works on it's own. I get Runtime error 1004 when I add the IFERROR part.

Thanks,

swjtx99
0
Comment
Question by:swjtx99
  • 3
  • 3
6 Comments
 
LVL 33

Accepted Solution

by:
Norie earned 500 total points
ID: 41868781
Whenever you have double quotes in the middle of a string in VBA you need to double them up.
ActiveCell.Formula = "=(IFERROR(VLOOKUP(N2,Sheet3!$A:$B,2,FALSE),"""")"

Open in new window

0
 

Author Comment

by:swjtx99
ID: 41868828
Hi Norie,

Thanks. I tried that and get the same results.
0
 
LVL 33

Expert Comment

by:Norie
ID: 41868839
Oops, didn't notice the extraneous ( at the start.

Try this.

ActiveCell.Formula = "=IFERROR(VLOOKUP(N2,Sheet3!$A:$B,2,FALSE),"""")"

Open in new window

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:swjtx99
ID: 41868844
Hi Norie,

Double Double quotes along with another parenthesis did it.

Thanks,

ActiveCell.Formula = "=(IFERROR(VLOOKUP(N2,Sheet3!$A:$B,2,FALSE),""""))"
0
 

Author Closing Comment

by:swjtx99
ID: 41868845
Double quotes worked. Thanks,
0
 
LVL 33

Expert Comment

by:Norie
ID: 41868847
Instead of adding a parenthisis you should remove the one after the = sign.

MInd you enclosing the entire formula in () won't do any harm.:)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question