To do this, you'll need an array formula.
Assume cell A1 contains the following c:\My Documents\Budgets\Jan04.xls
In cell B1, enter =MID(B1,MAX((MID(B1,ROW(INDIRECT("1:" &
LEN(B1))),1)="\")*ROW(INDIRECT("1:" &LEN(B1))))+1,LEN(B1))
DO NOT hit the enter key, instead hit Ctrl-Shift-Enter and this will create
an array formula with braces around it. Should give you what you are
looking for.
You could use fill or copy to copy this down 9000 rows. However, I would
use keyboard shortcuts. Assuming there are no blank spaces in column A,
select any cell then press End and then Down Arrow. This should take you to
the bottom. Now select the bottom most cell in column B and enter some
characters. Any characters will do. You are just marketing a stopping
point. Assuming no data in column B except for this cell and the formula in
B1, select End and then Up Arrow and you should fly to the top. Now, while
on the formula cell, select copy (ctrl-C or click the icon). Next, hold
down Shift then select End and Down Arrow. This should "paint" the range
all the way to the dummy value at the bottom. Take your finger off of
Shift, hit Enter and presto, you've copied the formulas. I can do this set
of key strokes in probably three or for seconds so once you know it, it is
very quick.
FYI - I wrote a neat little Excel program that copies the names and paths of
all of the files in a certain folder. Sure beats typing them in. I plan to
post in on my web-site. If you are interested in this freebie, reply to the
group and I'll do it sooner rather than later.
- John
www.JohnMichl.com