Hi All,
As usual... again i rammed into a simple problem. I wish to get a listing of all the files in a particular folder which is on my network.
I was able come up with a macro that can actually create this listing along with the "relative path" of the files. However, now my manager is asking me to make this path as active hyperlinks. I dont really have any experience in doing this.
Please can someone help. I have included a sample of my worksheet below. Also, I have included the code of the macro that i use for creating the list of files.
Thanks,
Lonely
**********************
*****************************
As usual... again i rammed into a simple problem. I wish to get a listing of all the files in a particular folder which is on my network.
I was able come up with a macro that can actually create this listing along with the "relative path" of the files. However, now my manager is asking me to make this path as active hyperlinks. I dont really have any experience in doing this.
Please can someone help. I have included a sample of my worksheet below. Also, I have included the code of the macro that i use for creating the list of files.
Thanks,
Lonely
**********************
Book1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | FileName | FileSize | FileType | |||
2 | All\final10.ppt | 585216 | MicrosoftPowerPointPresentation | |||
3 | All\final11.ppt | 246784 | MicrosoftPowerPointPresentation | |||
4 | All\final2.ppt | 616448 | MicrosoftPowerPointPresentation | |||
5 | All\final3.ppt | 585216 | MicrosoftPowerPointPresentation | |||
6 | AllProcesses\budg.zip | 2353312 | WinZipFile | |||
7 | AllProcesses\b_plan.ppt | 196096 | MicrosoftPowerPointPresentation | |||
8 | AllProcesses\close.zip | 1986552 | WinZipFile | |||
Sheet1 |
*****************************
Code:
Sub TestListFilesInFolder()
Workbooks.Add
With Range("A1")
.Formula = "Folder contents:"
.Font.Bold = True
.Font.Size = 12
End With
Range("A3").Formula = "File Name:"
Range("B3").Formula = "File Size:"
Range("C3").Formula = "File Type:"
Range("D3").Formula = "Date Created:"
Range("E3").Formula = "Date Last Accessed:"
Range("F3").Formula = "Date Last Modified:"
Range("G3").Formula = "Attributes:"
Range("H3").Formula = "Short File Name:"
Range("A3:H3").Font.Bold = True
ListFilesInFolder "C:\Files\", True
End Sub