A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
You have wbResult created in the wrong place
The following will import all the CSVs from 'FolderPath' into the active sheet of the new workbook 'wbResult' , omitting the header rows
Option Explicit
Sub CombineCsvs()
Dim FolderPath As String
Dim FileName As String
Dim wbResult As Workbook
Dim WB As Workbook
FolderPath = "C:\testfolder\inputfiles"
If FolderPath Like "*[!/]" Then
FolderPath = FolderPath & "/"
End If
FileName = Dir(FolderPath & "*.csv")
Set wbResult = Workbooks.Add
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Do While FileName <> vbNullString
Set WB = Workbooks.Open(FolderPath & FileName)
WB.ActiveSheet.Rows(1).EntireRow.Delete
WB.ActiveSheet.UsedRange.Copy wbResult.ActiveSheet.UsedRange.Rows(wbResult.ActiveSheet.UsedRange.Rows.Count).Offset(1).Resize(1)
WB.Close False
FileName = Dir()
Loop
wbResult.ActiveSheet.Rows(1).EntireRow.Delete
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub