I created a macro to loop through a folder and format all the excel files in that folder, but the formatting part isn't working any longer. It worked fine on Friday. It's suppose to delete certain columns and rows:
'Loop through each Excel file in folder
Do While myfile <> ""
'Set variable equal to opened workbook
Set wb = Workbooks.Open(fileName:=mypath & myfile)
'Ensure Workbook has opened before moving on to next line of code
' DoEvents
With Worksheets("mdballsearch")
.Rows("1:5").Delete
.Columns("A:A").Delete
.Columns("B:B").Delete
.Columns("C:C").Delete
.Columns("E:E").Delete
.Columns("D").Delete
End With
'Loop through each Excel file in folder
Do While myfile <> ""
'Set variable equal to opened workbook
Set wb = Workbooks.Open(fileName:=mypath & myfile)
'Ensure Workbook has opened before moving on to next line of code
' DoEvents
With Worksheets("mdballsearch")
.Rows("1:5").Delete
.Columns("A:A").Delete
.Columns("B:B").Delete
.Columns("C:C").Delete
.Columns("E:E").Delete
.Columns("D").Delete
End With