A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
My apologies, my code had strFile twice where it should have been stFile.
Sub GetFromCSVs()
Dim WB As Workbook
Dim R As Range
Dim bFirst As Boolean
Dim stFile As String
Dim stPath As String
stPath = "C:\Temp\CSVs" ' change the path to suit
stPath = "C:\Users\gebruiker\Documents\Excel"
stFile = Dir(stPath & "*.csv")
bFirst = True
Set R = Workbooks.Add(xlWorksheet).Sheets(1).Range("A1")
Do Until stFile = ""
Set WB = Workbooks.Open(stPath & stFile, ReadOnly:=True)
If bFirst Then
WB.Sheets(1).Range("A1").CurrentRegion.Columns(1).Copy Destination:=R.Offset(1)
Set R = R.Offset(, 1)
bFirst = False
End If
R.Value = Left(stFile, Len(stFile) - 4)
WB.Sheets(1).Range("A1").CurrentRegion.Columns(2).Copy Destination:=R.Offset(1)
Set R = R.Offset(, 1)
WB.Close SaveChanges:=False
stFile = Dir ' next file
Loop
End Sub