I have 2 macros in a spreadsheet. Macro1 calls Macro2 to open a series of csv's and convert them to excel files.
the roblem is that the macro works perfectly for all the subroutine calls except for the very first one (Macro2 "monthship", "monthship.xls"). The output file for this call is not parsed in separate columns, it is all grouped in Column A. I've tested the data and it is formatted like all the others. I don't understand why the macro would perform in this manner. Any ideas on where to look for problems?
Sub Macro1()
ChDir "C:\monthship\"
Macro2 "monthship", "monthship.xls"
Macro2 "monthship_1_2_10_42", "monthship_1_2_10_42.xls"
Macro2 "monthship_5_35", "monthship_5_35.xls"
Macro2 "monthship_2_10_35", "monthship_2_10_35.xls"
End Sub
Sub Macro2()
Workbooks.OpenText Inpoot, xlWindows, 1, xlDelimited, xlTextQualifierDoubleQuote, False, True, False, False, False, False, False, _
Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 1))
ActiveWindow.Zoom = 70
Cells.Select
Cells.EntireColumn.AutoFit
Selection.NumberFormat = "$#,##0"
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Columns("A:A").ColumnWidth = 4.5
Range("A:A,C:C,B:B").Select
Range("B1").Activate
Selection.Font.Bold = True
Range("A:A,C:C,B:B,1:1,2:2,3:3,4:4,5:5,6:6").Select
Range("A6").Activate
Selection.Font.Bold = False
Selection.Font.Bold = True
Cells.Select
Cells.EntireColumn.AutoFit
Columns("A:A").Select
Selection.NumberFormat = "General"
Range("A1").Select
ChDir "C:\monthship"
ActiveWorkbook.SaveAs "C:\Monthship\" & Outpoot, 56, , , , False
ActiveWindow.Close
End Sub
Bookmarks