Program nam generira excel datotko - zbir podatkov - meritev in jih spravlja na direktorij. vsako s svojim imenom -ni ključa za ime.
Sedaj bi pa rad vse te podatke združil v en excel - pregled nad vsemi meritvami v vseh datotekah na direktoriju.
Nekaj takega imam v glavi - poženem excel, (ta prebere vsebino direktorija za datotekami in iz vseh pobere podatkein jih da v eno preglednico/list - po stolpcih, vrsticali vseeno).
Ena VBA koda se mi je pokazala na GOOOGLE, ampak mi ne dela. Nisem glih trd ko diamant, ampak rabi pomoč.
KODA*
Sub main()
Dim objFSO As Object
Dim objFSO2 As Object
Dim objFolder As Object
Dim objFolder2 As Object
Dim objSubFolder As Object
Dim objSubFile As Object
Dim i As Integer
‘This is the path to the directory
Dim PATH As String
‘The directory path
PATH = “D: Data”
‘Create an instance of the FileSystemObject
Set objFSO = CreateObject(“Scripting.FileSystemObject”
‘Get the folder object
Set objFolder = objFSO.GetFolder(PATH)
i = 1
‘loops through each file in the directory and prints their names and path
For Each objSubFolder In objFolder.subfolders
Set objFSO2 = CreateObject(“Scripting.FileSystemObject”
Set objFolder2 = objFSO2.GetFolder(PATH + “” + objSubFolder.Name)
For Each objSubFile In objFolder2.Files
‘objSubFile will iterate through all the files in the sub folder
Next objSubFolder
Next objSubFolder
End Sub
End Sub
Sedaj bi pa rad vse te podatke združil v en excel - pregled nad vsemi meritvami v vseh datotekah na direktoriju.
Nekaj takega imam v glavi - poženem excel, (ta prebere vsebino direktorija za datotekami in iz vseh pobere podatkein jih da v eno preglednico/list - po stolpcih, vrsticali vseeno).
Ena VBA koda se mi je pokazala na GOOOGLE, ampak mi ne dela. Nisem glih trd ko diamant, ampak rabi pomoč.
KODA*
Sub main()
Dim objFSO As Object
Dim objFSO2 As Object
Dim objFolder As Object
Dim objFolder2 As Object
Dim objSubFolder As Object
Dim objSubFile As Object
Dim i As Integer
‘This is the path to the directory
Dim PATH As String
‘The directory path
PATH = “D: Data”
‘Create an instance of the FileSystemObject
Set objFSO = CreateObject(“Scripting.FileSystemObject”
‘Get the folder object
Set objFolder = objFSO.GetFolder(PATH)
i = 1
‘loops through each file in the directory and prints their names and path
For Each objSubFolder In objFolder.subfolders
Set objFSO2 = CreateObject(“Scripting.FileSystemObject”
Set objFolder2 = objFSO2.GetFolder(PATH + “” + objSubFolder.Name)
For Each objSubFile In objFolder2.Files
‘objSubFile will iterate through all the files in the sub folder
Next objSubFolder
Next objSubFolder
End Sub
End Sub