+ Reply to Thread
Results 1 to 11 of 11

Vlookup vba code formule not working

  1. #1
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Vlookup vba code formule not working

    Hello community,

    I'm having trouble in this code:
    Please Login or Register  to view this content.
    When i g to L35 is shows me: =SE.ERRO(PROCV('P35';Validações!'AK2':'AM500';2;FALSO);"?")

    The only problem is the " ' " (apostrophe) i don't know how can i remove it in the code...

    Define range in variable?

  2. #2
    Registered User
    Join Date
    11-04-2013
    Location
    Chesham
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Vlookup vba code formule not working

    what value do you want L35 to be if the result is error?

    At the moment it looks like you want "?" instead of just ?.

    Surely just ? will suffice?

    If so you code should be:
    Worksheets("ORDEM TRABALHO TAPASOIS").Select
    Range("L35").Select
    ActiveCell.FormulaR1C1 = "=IFERROR(VLOOKUP(P35,Validações!AK2:AM500,2,FALSE),"?")"

  3. #3
    Registered User
    Join Date
    11-27-2014
    Location
    Wolverhampton, England
    MS-Off Ver
    2013
    Posts
    49

    Re: Vlookup vba code formule not working

    Edit: See post below
    Last edited by owenaldridge; 09-16-2015 at 10:37 AM.

  4. #4
    Registered User
    Join Date
    11-27-2014
    Location
    Wolverhampton, England
    MS-Off Ver
    2013
    Posts
    49

    Re: Vlookup vba code formule not working

    Hi,

    Try:
    Please Login or Register  to view this content.
    Owen

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Vlookup vba code formule not working

    Remove the .R1C1

    ActiveCell.Formula.R1C1 = "=IFERROR(VLOOKUP(P35,Validações!AK2:AM500,2,FALSE),""?"")"

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,376

    Re: Vlookup vba code formule not working

    It's not an R1C1 formula:

    Please Login or Register  to view this content.
    But use this:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Vlookup vba code formule not working

    Quote Originally Posted by TMS View Post

    Please Login or Register  to view this content.

    Regards, TMS
    Works that way, i had tried but used R1C1. My bad.

    Thank you all for helping.

  8. #8
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Vlookup vba code formule not working

    Quote Originally Posted by Jonmo1 View Post
    Remove the .R1C1

    ActiveCell.Formula.R1C1 = "=IFERROR(VLOOKUP(P35,Validações!AK2:AM500,2,FALSE),""?"")"
    Thanks. That worked

  9. #9
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Covilhã
    MS-Off Ver
    2010
    Posts
    516

    Re: Vlookup vba code formule not working

    Quote Originally Posted by owenaldridge View Post
    Hi,

    Try:
    Please Login or Register  to view this content.
    Owen
    Worked perfecly as well.
    Thanks

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Vlookup vba code formule not working

    You're welcome.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,376

    Re: Vlookup vba code formule not working

    You're welcome. Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Vlookup code not working in this instance only
    By dubcap01 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-29-2015, 01:00 AM
  2. Formule =ALS
    By mazaike in forum Non English Excel
    Replies: 3
    Last Post: 06-27-2015, 07:55 AM
  3. [SOLVED] Pattern Building VBA Code - Working code, would like to use cleaner code
    By Benisato in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-10-2015, 03:05 PM
  4. [SOLVED] Vba code working in workbook module but not working from personal.xlb
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-19-2014, 05:47 AM
  5. Replies: 1
    Last Post: 11-13-2013, 10:28 AM
  6. Replies: 1
    Last Post: 10-04-2013, 05:54 PM
  7. dynamic range (table_array) in vlookup formule
    By cuoredicapitano in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-11-2010, 11:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1