The code below works great when I do a "Step into" the code, and pastes the data from each file into the "Cisco Database" file. However, when I just run it, it always leaves off the last file. I added a specific line to save the DB file each time, to no avail. Any suggestions?
Sub AppendDataFinal()
Dim myWorkbook As String
myDB = "CiscoDatabase.xlsx"
myWorkbook = "Cisco.xlsm"
Application.Run "'Cisco.xlsm'!importfile" //grabs all .csv files from a folder
For Each wb In Workbooks
If (wb.Name <> myWorkbook) Then wb.Activate
Columns("A:O").Select
Selection.Delete Shift:=xlUp
Columns("O:AS").Select
Selection.Delete Shift:=xlUp
Selection.CurrentRegion.Select
Selection.Copy
Workbooks.Open ("file path")
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste , False
Range("A1").Select
If (ActiveWorkbook.Name = myDB) Then ActiveWorkbook.Save
ActiveWorkbook.Close
ActiveWorkbook.Close savechanges:=False
Next wb
Workbooks.Open ("file path and name")
Application.Run "Cisco.xlsm!DateFormat" //trims time off date row, pretties up data
End Sub