For some reason this VBA does not run when I insert it into the module? Any suggestions?
Sub vba_combine_workbooks ( )
Dim Path As String
Dim Filename As String
Dim Sheet As Worksheet
Path = “C:\Users\Dwight\Documents\"
Filename = Dir (Path & “*.cvs”)
Do While Filename <> “”
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=thisWorkbook.Sheets(1)
Next Sheet
Workbooks (Filename).Close
Filename = Dir ()
Loop
End Sub
Sub vba_combine_workbooks ( )
Dim Path As String
Dim Filename As String
Dim Sheet As Worksheet
Path = “C:\Users\Dwight\Documents\"
Filename = Dir (Path & “*.cvs”)
Do While Filename <> “”
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=thisWorkbook.Sheets(1)
Next Sheet
Workbooks (Filename).Close
Filename = Dir ()
Loop
End Sub