Forum Discussion
vlookup as a macro
Matt Mickle Hello - i saw this post as part of a google search. I am trying to create a code that looks up an identification id number on one worksheet, and finds the corresponding data to it on another sheet. I will end up with columns of data corresponding to different entry times in my data sheet. I have the movement flow of the formula down, but when i got to run the code consecutively, it seems that my vlookup formula continues to move right in the spreadsheet, instead of holding constant at the identification id cell. I am using the formula below. do you know how to hold the cell constant, so that it will always look up the same ID number? The part i am having issues with is the RC[-4], i would need it to increase every time (-4,-5,-6,etc...) if i leave it in this format...
ActiveCell.Formula = "=VLOOKUP(RC[-4],'Data Import'!R3C5:R2226C6,2,FALSE)"