I have 8 workbooks all with one sheet and I'm trying to import them into one master workbook using VBA. This is the code I'm using, it's my first time using VBA.
Sub ImportStats()
Dim WbDest As Workbook
Dim wbSource As Workbook
Dim wsSource As Worksheet
Dim myPath As String
Dim strFileName As String
myPath = ThisWorkbook.path & "\stats\"
Set weDest = ThisWorkbook
strFileName = Dir(myPath)
Do Until strFileName = ""
Set wbSource = Workbooks.Open(Filename:=myPath & "\" & strFileName)
Set wsSource = wbSource.Worksheets(1)
wsSource.Copy after:=WbDest.Worksheets("National2")
wbSource.Close
strFileName = Dir()
Loop
End Sub