[AccessD] Excel Vlookup() question

Arthur Fuller fuller.artful at gmail.com
Tue Aug 14 10:43:34 CDT 2007


Thanks for looking at this, Jim. That was just a typo on my part. In fact, I
don't think I expressed my problem accurately. When I use the second formula
directly in a worksheet, it works fine, but I cannot make it work in a
module and that's what I need to do. Something along the lines of

Dim x
x = VLOOKUP( $A6, "path_and_filename", relative_column, false)

Maybe it's first argument that's the problem from VBA's viewpoint. Maybe I
need to thoroughly specify the cell? I'll try that.

Also I have another problem. In the workbook containing the code, I have 3
columns for Class A, B and C. In the lookup workbook,  these classes, if
they exist, will be represented as  rows.  So having  found the company
number with Vlookup, I then need to walk the rows and examine the adjacent
column to see what class the item is. If it's A, I write the value to
retrieve into the Class A column. If it's B, into the Class B column, etc.
Too bad Vlookup can't handle a compound argument :(. But anyway, I can just
do a loop until the company number changes, since the table is sorted by
company number.

Thanks,
Arthur

On 8/14/07, Jim Lawrence <accessd at shaw.ca> wrote:
>
> Hi Arthur:
>
> Not testing anything and assuming that files are correct, receiving
> spreadsheet is correct the only difference between the 2 lines is one has
> a
> "=VLOOKUP(...   one is proceeded an '=' or calculate sign
> "VLOOKUP(...    and the other is not
>
> HTH
> Jim
>



More information about the AccessD mailing list