Ok folks, I am not really sure where to go with this, all my VBA has so far been confined to manipulating one document. I have been asked to make a report from 40 CSV files and compile them into one Excel doc. I only need a couple values out of each file.
Here is my code so far, I have been trying some things with setting the FileSystemObject, but it is too ugly to include.
The files are all in order with the name 277.csv, 278.csv, 279.csv, etc. I am needing to grab row 7, values 1 and 10 from each CSV. I am really at a loss as to where to go with this. Any help would be awesome!
Dan
Here is my code so far, I have been trying some things with setting the FileSystemObject, but it is too ugly to include.
Code:
Dim strDate As String, strFolder As String
Set fso = CreateObject("Scripting.FileSystemObject")
strDate = InputBox("Please enter a day to generate data. (MM/DD/YYYY)", "Select Date", Date - 1)
If LenB(strDate) = 0 Then Exit Sub
strFolder = "\\Opr.statefarm.org\dfs\OC\20\WORKGROUP\GRLYOPEN\LRC\Planning\Data\" & Year(strDate) & "-" & Month(strDate) & "-" & Day(strDate) & "\"
If fso.FolderExists(strFolder) Then
'Do Stuff
Else
MsgBox "There is no data for that date!"
End If
The files are all in order with the name 277.csv, 278.csv, 279.csv, etc. I am needing to grab row 7, values 1 and 10 from each CSV. I am really at a loss as to where to go with this. Any help would be awesome!
Dan