Assuming that in every file you're working on sheet(1)
this would do the job:
Option Explicit
Sub ColumnMover()
Dim i As Integer, j As Integer, k As Integer, m As Integer, n As Integer
Dim mDirs As String
Dim path As String
Dim OutFile As Variant, SrcFile As Variant
Dim MyObj As Object, MySource As Object, file As Variant
OutFile = ActiveWorkbook.Name
mDirs = "c:\" 'your path here with \ in the end
file = Dir(mDirs)
While (file <> "")
path = mDirs + file
Workbooks.Open (path)
SrcFile = ActiveWorkbook.Name
n = 2
While Workbooks(OutFile).Sheets(1).Cells(n, 1).Value <> ""
n = n + 1
Wend
i = 2
While (Workbooks(OutFile).Sheets(1).Cells(1, i).Value <> "")
k = n
j = 1
While Workbooks(SrcFile).Sheets(1).Cells(1, j).Value <> Workbooks(OutFile).Sheets(1).Cells(1, i).Value And _
Workbooks(SrcFile).Sheets(1).Cells(1, j).Value <> ""
j = j + 1
Wend
If Workbooks(SrcFile).Sheets(1).Cells(1, j).Value = Workbooks(OutFile).Sheets(1).Cells(1, i).Value Then
m = 2
While Workbooks(SrcFile).Sheets(1).Cells(m, j).Value <> ""
Workbooks(OutFile).Sheets(1).Cells(k, 1).Value = path
Workbooks(OutFile).Sheets(1).Cells(k, i).Value = Workbooks(SrcFile).Sheets(1).Cells(m, j).Value
k = k + 1
m = m + 1
Wend
End If
i = i + 1
Wend
Workbooks(file).Close (False)
file = Dir
Wend
End Sub
EDIT:
Some explanation:
here the template file and the output file are the same. So first you have to have an xlsm with the structure on sheet(1):
FileName,Heading1,Heading2,Heading3,Heading4,Heading5,Heading6,Heading7
then enter the given code into this file, and run it when the output file is the active sheet.