Solved

IFERROR(VLOOKUP

Posted on 2016-11-01
6
46 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 34

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 34

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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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 34

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

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…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

707 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