Hi
This isn't complete (way too many output columns!!!), but it should get you going. It assumes that the macro is in the output workbook, the output sheet is "Sheet 1" and it already exists in the output workbook along with the column headings.
Sub aaa()
Dim OutSH As Worksheet
Set OutSH = ThisWorkbook.Sheets("Sheet 1")
FileNames = Application.GetOpenFilename(MultiSelect:=True)
For i = LBound(FileNames) To UBound(FileNames)
Set thisone = Workbooks.Open(FileNames(i))
For j = 7 To Cells(Rows.Count, 1).End(xlUp).Row
outrow = OutSH.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
OutSH.Cells(outrow, 1).Value = "ELEC"
OutSH.Cells(outrow, 2).Value = WorksheetFunction.Trim(Cells(j, 2))
OutSH.Cells(outrow, 3).Value = Format(Cells(j, 4), "YYYYMMDD")
OutSH.Cells(outrow, 4).Value = 0
OutSH.Cells(outrow, 7).Value = Format(Cells(j, "H"), "00.00")
OutSH.Cells(outrow, 8).Value = Format(Cells(j, "G"), "00.00")
OutSH.Cells(outrow, 9).Value = Format(Cells(j, "F"), "00.00")
OutSH.Cells(outrow, 13).Value = "M"
OutSH.Cells(outrow, 15).Value = "MAN"
OutSH.Cells(outrow, 16).Value = Cells(j, "E").Value
Next j
ActiveWorkbook.Close savechanges:=False
Next i
End Sub
rylo
Bookmarks