Sounds like you need to use the INDIRECT function and have the invoice # referenced in a separate cell.
Unfortunately, INDIRECT doesn't work when external source workbook is not open.
I suppose you could run a routine that creates the formula with the right file reference without using the INDIRECT function, pulling in the invoice # as a variable in a string that gets fed back out to the cell.
For Each cell in Range("A1:A" & Rows.Count).End(xlUp).Row
InvRef = cell.value
r = cell.row
Let Range("B"& r") = FormulaR1C1 = "=[" & InvRef & ".xls]Sheet1!R1C1"
Next Cell
This would look at all entries in column A.
Formula string will also need text for the file path. To get the syntax, set up a link between two files and then close the source file. The formula in the destination file will then change to include the filepath. The filepath will need to added into the text string within the quotes before the first square bracket [.
Hopefully gets you started.
Cheers
Rob H
Main Topics
Browse All Topics





by: lostsidePosted on 2009-08-20 at 07:20:05ID: 25142825
only with VBA i think