+ Reply to Thread
Results 1 to 5 of 5

Vlookup loop

  1. #1
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249

    Vlookup loop

    Hi

    I have spreadsheet that runs through a macro on a dailly basis, however, I have noticed a problem with the VLOOKUP in the macro as it is failing to pick up some of the results due to the Range Data moving with each row it passes through.

    The VLOOKUP if processing normally in Excel would be

    =VLOOKUP(C3,FundList!$A$2:$B$301,2,0)

    However, when running through the code it is adding on a row as if the "$" was not being used.

    My VBA code is (which is obviously not working is)

    "=VLOOKUP(RC[-13],FundList!R[-1]C[-15]:R[298]C[-14],2,0)"

    My Range that I need to use is in a sheet named FundList and is from A2:B300

    My main sheet is "MF"

    Any help would be greatly appreciated.

    Thanks
    McCrimmon

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249
    The search criteria in Column 3 changes with everyrow.

    So I do not always want to use C3.

    How do I change this so that it searches the result from

    C3
    D3
    E3

    etc etc

  4. #4
    Forum Contributor mccrimmon's Avatar
    Join Date
    02-19-2004
    Location
    Scotland
    MS-Off Ver
    2003
    Posts
    249
    I have now resolved this issue:

    x = 1

    Please Login or Register  to view this content.
    Thanks
    Last edited by VBA Noob; 09-25-2008 at 08:52 AM.

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Good to see but please remember to use code tags as per the forum rules below

    VBA Noob

+ 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. Loop function with vlookup
    By Engineers08 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-20-2012, 11:28 PM
  2. Vlookup using two columns-needs to match the first two column
    By pduubb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-01-2008, 01:21 PM
  3. Programming a Find Loop?
    By mcbain in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-21-2008, 04:44 AM
  4. Loop + vLookup cause formula too long
    By asyuradou in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-23-2007, 11:38 AM
  5. Extend Loop From Within ?
    By Blewyn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2007, 05:34 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