Below I found a VBA Script online that takes all worksheets from workbooks in a directory, and combines them all in one workbook as separate sheets. However, I don't want them to be separate sheets. I want all data in the sheets to be in a single worksheet.
Sub GetSheets()
Path = "Desktop\RandoDir"
Filename = Dir(Path & "\*.csv*")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
'MsgBox Filename ---Debugging
Sheet.Copy After:=ThisWorkbook.Sheets(1)
Next Sheet
Workbooks(Filename).Close
Filename = Dir()
Loop
End Sub
If I had data structured like this in two files:
**File1** **File2**
Header1|Header2 | Header1|Header2
Tim |Smith | Mike |Jones
I want the merged worksheet to display
**File3**
Header1|Header2
Tim |Smith
Mike |Jones