Sub a()
Dim fPath As String
Dim fSKV As String
Dim wbSKV As Workbook
Dim wsMstr As Worksheet
Set wsMstr = ThisWorkbook.Sheets("Mätvärden")
fPath = "P:\8203 Vrena Deponi\11 UNDERLAG\Loggdata från Vrena\2013\02\" 'path to SKV files, include the final \
If MsgBox("Rensa befintliga mätvärden innan import?", vbYesNo, "Rensa?") _
= vbYes Then wsMstr.UsedRange.Clear
Application.ScreenUpdating = False 'speed up macro
fSKV = Dir(fPath & "*.SKV") 'start the SKV file listing
r = 1
Do While Len(fSKV) > 0
Set wbSKV = Workbooks.Open(fPath & fSKV)
s = CreateObject("scripting.filesystemobject").opentextfile(fPath & fSKV).readall
s1 = Replace(s, vbCrLf, ";")
sn = Split(s1, ";")
For j = 0 To UBound(sn)
sp = Split(sn(j), ";")
u = UBound(sp)
If u <= 0 Then u = 0
Cells(r, j + 1).Resize(u + 1) = sp
Next
'ready next SKV
fSKV = Dir
r = r + 1
Loop
Application.ScreenUpdating = True
End Sub
attach a sample file with desired result
Bookmarks