Hale, Jim
Jim.Hale at FleetPride.com
Tue Aug 14 11:45:50 CDT 2007
Try WorksheetFunction.VLOOKUP($A6, "path_and_filename", relative_column, false) HTH Jim Hale -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Tuesday, August 14, 2007 10:44 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Excel Vlookup() question 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 > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com *********************************************************************** The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please contact the sender and delete the material from any computer. As a recipient of this email, you are responsible for screening its contents and the contents of any attachments for the presence of viruses. No liability is accepted for any damages caused by any virus transmitted by this email.