PC Review


Reply
Thread Tools Rate Thread

Copy and paste file name

 
 
=?Utf-8?B?c2ViYXN0aWNv?=
Guest
Posts: n/a
 
      7th Jul 2007
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 With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      7th Jul 2007

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"
<(E-Mail Removed)>
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy, paste without file name referenced after paste AusTexRich Microsoft Excel Misc 6 23rd Sep 2008 02:57 AM
Copy from closed excel file and paste to master file then loop for same siles Steve B Microsoft Excel Programming 2 6th Mar 2007 06:36 AM
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 Steven Microsoft Excel Programming 1 17th Oct 2005 08:56 AM
Copy/paste from file =?Utf-8?B?bmM=?= Microsoft Excel Programming 1 6th Oct 2005 05:04 PM
Re: copy and paste mdw file Joan Wild Microsoft Access Security 0 28th Apr 2004 04:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:12 AM.