Solved

IFERROR(VLOOKUP

Posted on 2016-11-01
6
25 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Tags from access to excel 3 31
Freeze Panes Solution 6 28
Why doesn't duplicate values work on this spreadsheet? 6 36
Filling Blank Cells 14 21
Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

862 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now