Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub ListAllFilesInFolder() 'James Cone - San Francisco, USA - Oct. 2006 Dim strPath As String Dim oFSO As Object Dim oFile As Object Dim oFolder As Object Dim N As Long N = 1 strPath = "C:\Documents and Settings\user\My Documents\My Pictures" '<<< Set oFSO = CreateObject("Scripting.FileSystemObject") Set oFolder = oFSO.GetFolder(strPath) Cells(N, 1).Value = oFolder.Path N = N + 1 For Each oFile In oFolder.Files Cells(N, 2).Value = oFile.Name N = N + 1 Next 'oFile Set oFSO = Nothing Set oFile = Nothing Set oFolder = Nothing End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "sebastico" wrote in message .... Hello. I have a file with 2000 photos (jpg) and I need to copy the name of all photos at a time and paste into a xls file. How can I do this? Any help is welcome Sorry if this question does not belong to this community. If not could you suggest me where to address my question. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy, paste without file name referenced after paste | Excel Discussion (Misc queries) | |||
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro | Excel Programming | |||
Copy/paste from file | Excel Programming | |||
copy/paste from one file to another without file name reference | Excel Discussion (Misc queries) |