+ Reply to Thread
Results 1 to 8 of 8

Vlookup vb

  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    Gatineau, Qc, Canada
    MS-Off Ver
    Excel 2007 (Or Anything)
    Posts
    43

    Vlookup vb

    Good day everyone,

    I seek someone's experience,

    I'm trying to create a bLastRecon = "FilePath" within the following:

    "=VLOOKUP(RC[-6], 'S:\[BASS8.xlsx]P8'!C4:C10,7,FALSE)"

    Any help?

    I've tried the following without success,
    'No good
    ' "=VLOOKUP(D4, 'S:\[BASS8.xlsx]P8'!D4:J10,7,FALSE)"
    ' "=VLOOKUP(D4, '(bLastRecon)'!$D:$J,7,FALSE)"
    ' "=VLOOKUP(RC[-6], '(bLastRecon)'!C4:C10,7,FALSE)"

    HTML Code: 

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,007

    Re: Vlookup vb

    What is the nature of the failure? Does it compile? Does it run to completion with the wrong result in the worksheet? Does it stop with an error?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-26-2012
    Location
    Gatineau, Qc, Canada
    MS-Off Ver
    Excel 2007 (Or Anything)
    Posts
    43

    Re: Vlookup vb

    Quote Originally Posted by 6StringJazzer View Post
    What is the nature of the failure? Does it compile? Does it run to completion with the wrong result in the worksheet? Does it stop with an error?
    Script works fine, but I want to be able to modify the path at the top instead at the Vlookup function within the code

    "=VLOOKUP(RC[-6], 'S:\[BASS8.xlsx]P8'!C4:C10,7,FALSE)" <--- this works fine but I will need to change it manually within the code to P9 next time and the next time P10 etc. which is why I am seeking help in suggestions in coding this to reflect at the top level of the code bLastRecon = "S:\[BASS8.xlsx]P8"

    I've tried to remove the brackets from "=VLOOKUP(RC[-6], '(bLastRecon)'!C4:C10,7,FALSE)" but it fails to work at all, makes me open 2 times the actual file that i need to browse for it to load and also doesn't work at all and comes with #NAME instead of the usual #N/A with the normal script. Some people put the variables with v, i put a b instead (bLastRecon)

    Let me know if you know what I mean by this,

    Thank you in advance

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,007

    Re: Vlookup vb

    If bLastRecon is a variable then you want
    Please Login or Register  to view this content.
    See correction below, extra quote marked above
    Last edited by 6StringJazzer; 11-23-2012 at 10:27 PM. Reason: flagged error, see correction below

  5. #5
    Registered User
    Join Date
    10-26-2012
    Location
    Gatineau, Qc, Canada
    MS-Off Ver
    Excel 2007 (Or Anything)
    Posts
    43

    Re: Vlookup vb

    Quote Originally Posted by 6StringJazzer View Post
    If bLastRecon is a variable then you want
    Please Login or Register  to view this content.

    Thx 6String !, I will test first thing on Monday and come back to confirm if it works,

    Keep you posted

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,007

    Re: Vlookup vb

    I didn't take the time to test this, but I just saw an error. There was an extra double-quote mark, after the first comma:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-26-2012
    Location
    Gatineau, Qc, Canada
    MS-Off Ver
    Excel 2007 (Or Anything)
    Posts
    43

    Re: Vlookup vb

    Works great 6StringJazzer ! Thank you for your help

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,007

    Re: Vlookup vb

    Glad to hear it! You're very welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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