Discussion Locked
0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I need to copy line 2 from every spreadsheet in a directory. I have control of the spreadsheet design but no control of its name nor do I know how many spreadsheets there will be in the directory. I have the copying routine down but need the for..next concept
1 reply
by jscragg
Private Sub EnumerateFolder(strFolderPath)
Dim objFSO As Scripting.FileSystemObject
Dim objFolder As Scripting.Folder
Dim objFiles As Scripting.Files
Dim objFile As Scripting.File
Set objFSO = New Scripting.FileSystemObject
Set objFolder = objFSO.GetFolder(strFolderPath)
Set objFiles = objFolder.Files
For Each objFile In objFiles
' This will enumerate the collection of files
' found in the specified folder.
' Do your work here.
Next objFile
End Sub
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending
Discussion Locked
What Makes a Business Website Effective in 2026
2 helpful
10 replies
1 helpful
3 replies
Question
Windows and macOS computers becoming slow or unstable after updates - what should I check first
0 helpful
1 reply
Question Unanswered
Best Way to Make Long WordPress Location Guides Mobile Friendly
0 helpful
0 replies
Discussion
Optimizing WordPress widgets and DOM size
0 helpful
3 replies