View Single Post
  #3   Report Post  
Harlan Grove
 
Posts: n/a
Default

JJC wrote...
I have a vlookup that goes out to another file.

Because the other file has several worksheets it is only searching on the
worksheet that was selected is there any way to get the vlookup to look at
all the worksheets within a workbook.

Here is my statement.
=VLOOKUP(A19,'[New Monthly Invoices June 05.xls]Aug 05'!$D$1:$S$2,16)

It works fine, but only for the Aug 05 Sheet within the other workbooks,
please help me to search the entire workbook for this.


If you're really using approximate matching (no 4th argument to
VLOOKUP), it's complicated. If this other worksheet has worksheet names
in MMM YY format, then use a defined name in the workbook containing
the formulas to generate a list of the worksheet names in the other
workbook IN REVERSE ORDER, e.g.,

WSLst referring to =TEXT(DATE(2005,13-ROW(INDIRECT("1:12")),1),"MMM
YY")

Then use array formulas like

=VLOOKUP(A19,INDIRECT("'[New Monthly Invoices June
05.xls]"&INDEX(WSLst,
MATCH(TRUE,COUNTIF(INDIRECT("'[New Monthly Invoices June 05.xls]"&WSLst
&"'!D1:D2"),"<="&A19)0,0))&"'!D1:S2"),16)

The workbook, New Monthly Invoices June 05.xls, *MUST* be open for this
to work.