When merging files where you are "stacking" rows (Power Query or Copy-Paste), ensure you only paste the headers once. Power Query handles this automatically, but if doing it manually, copy the data excluding the header row from the second file onward to avoid having headers repeated in the middle of your data.
If you have two different files regarding the same items—for example, File A has "Customer Names" and File B has "Customer Emails"—you don't want to stack them; you want to join them side-by-side. how to merge excel files
Sub MergeAllFiles() Dim FolderPath As String, FileName As String Dim wbDest As Workbook, wbSrc As Workbook Dim LastRow As Long FolderPath = "C:\YourFolderPath\" ' Change this FileName = Dir(FolderPath & "*.xlsx") Set wbDest = ThisWorkbook When merging files where you are "stacking" rows