Macro STR_GetFilesxxx. Usage:
Cauton:
Sub Str_GetFiles() 'collect individual PDB files into a single workbook 'filenames are listed in the first column of the "Files"-worksheet WBname = ActiveWorkbook.Name For i = 1 To 255 Step 1 If IsEmpty(Sheets("Files").Cells(i, 1)) Then Exit For aaa = Sheets("Files").Cells(i, 1) 'get pdb file Workbooks.OpenText FileName:= _ aaa, Origin:= _ xlMacintosh, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _ Array(Array(0, 1), Array(6, 1), Array(11, 1), Array(13, 1), Array(16, 1), _ Array(17, 1), Array(20, 1), Array(21, 1), Array(22, 1), Array(26, 1), Array(27 _ , 1), Array(30, 1), Array(38, 1), Array(46, 1), Array(54, 1), Array(60, 1), _ Array(66, 1), Array(72, 1), Array(76, 1), Array(80, 1)) 'format columns Columns("A:A").Select Selection.ColumnWidth = 6 Columns("B:B").Select Selection.ColumnWidth = 5 Columns("C:C").Select Selection.ColumnWidth = 2 Columns("D:D").Select Selection.ColumnWidth = 3 Columns("E:E").Select Selection.ColumnWidth = 1 Columns("F:F").Select Selection.ColumnWidth = 3 Columns("G:G").Select Selection.ColumnWidth = 1 Columns("H:H").Select Selection.ColumnWidth = 1 Columns("I:I").Select Selection.ColumnWidth = 4 Columns("J:J").Select Selection.ColumnWidth = 1 Columns("K:K").Select Selection.ColumnWidth = 3 Columns("L:N").Select Selection.ColumnWidth = 8 Columns("O:Q").Select Selection.ColumnWidth = 6 Columns("R:R").Select Selection.ColumnWidth = 4 Columns("S:S").Select Selection.ColumnWidth = 4 Columns("L:L").Select Selection.NumberFormat = "0.000" Columns("M:M").Select Selection.NumberFormat = "0.000" Columns("N:N").Select Selection.NumberFormat = "0.000" Columns("P:P").Select Selection.NumberFormat = "0.00" Columns("O:O").Select Selection.NumberFormat = "0.00" Sheets(aaa).Move After:=Workbooks(WBname).Sheets(i) Next i End Sub |
|
|||||||||||||||||
Last Modified by A.Honegger |