Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching for file information

Status
Not open for further replies.

MarcLodge

Programmer
Feb 26, 2002
1,886
GB
Hi all,
I do not know enough about VBA to know if this is possible and would like a pointer in the right direction if it is.

I have a spreadsheet which contains a list of sub-directory names in column A. What I would like to do is to run a macro that examines the sub-directory for files, and any files that are found to have a hyperlink to that file placed in the next column along with the date last updated. I suspect that I will need to go to another worksheet other than the original sheet as I'd like to keep them in order.

For example:
Column A
Word
Excel
Powerpoint

returns:
Word C:\root\Word\letter1.doc 25/09/2005
Word C:\root\Word\letter2.doc 26/09/2005
Excel C:\root\Excel\Spreadie1.xls 14/11/2005
Powerpoint C:\root\Powerpoint\slide1.pps 15/10/2005

The top level directory (C:\root in the example) will always be known and static.

Is this an easy thing to accomplish?

Marc
 
Have a look at the Dir and FileDateTime functions.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
as PVH says.

but look at what I say in and see if you can make it apply to a cell. Certainly the add will work.

I always record a macro and see what VBA offers. Just "record" and do the manula stuf then stop the macro. Give them obvious names! It can be horribly wrong - rarely - but run the macro and it will be obvious. If it passes use the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top