Results 1 to 3 of 3

Thread: VBA Will Not Accept Vlookup Formula that Works in Sheet

  1. #1
    New Member CatLadee's Avatar
    Join Date
    Sep 2018
    Location
    Washington, DC, USA
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA Will Not Accept Vlookup Formula that Works in Sheet

    Any ideas why this formula won't work in VBA but will in the worksheet? The responses tab exists. How should it be updated? THANK YOU!

    Code:
        ActiveCell = "=IF(VLOOKUP(E2,Responses!E:R,8,FALSE)=0,"",(VLOOKUP(E2,Responses!E:R,6,FALSE)))"
        Range("J2").Select

  2. #2
    MrExcel MVP
    Join Date
    May 2009
    Posts
    16,449
    Post Thanks / Like
    Mentioned
    36 Post(s)
    Tagged
    8 Thread(s)

    Default Re: VBA Will Not Accept Vlookup Formula that Works in Sheet

    Quote Originally Posted by CatLadee View Post
    Any ideas why this formula won't work in VBA but will in the worksheet? The responses tab exists. How should it be updated? THANK YOU!

    Code:
        ActiveCell = "=IF(VLOOKUP(E2,Responses!E:R,8,FALSE)=0,"""",(VLOOKUP(E2,Responses!E:R,6,FALSE)))"
        Range("J2").Select
    Double the quote marks (Bold Red above) so VBA recognizes them as part of a string.
    Joe

    When I was a young man I knew everything. Now that I'm older, I realize I know very little, and what I do know, I tend to forget!

  3. #3
    New Member CatLadee's Avatar
    Join Date
    Sep 2018
    Location
    Washington, DC, USA
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA Will Not Accept Vlookup Formula that Works in Sheet

    Thanks a bunch, Joe! I appreciate your help!

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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