0
votes

There is 27 Excel files (Workbooks) and each Excel file would have 5 tabs (Sheets) or 2.

I want to copy each Sheet first Row of every files (27 Workbooks including their Sheets) to another new Excel Sheet (combine on Sheet) to check whether each file have same header or not.

1
And what your problem is? What have you tried?cathulhu
This link should get you started. Please show us what you have tried before posting a question.zx8754

1 Answers

0
votes

Here is few things you might need;

Dim wb As Workbook
Dim rowCopy As Range
For Each sFilename In listOfFiles
    Set wb = Workbooks.Open(sFilename)
    Set rowCopy = wb.Range([rangewheretocopy])

    rowCopy.Copy

    shWhereYouCopyItAll.Range([targetrange]).PasteSpecial
Next

Assuming hypothetical list of files listOfFiles which you can foreach for string sFilename in order to open the Workbooks. Then set Range object rowCopy to the range where that one row is, then call your local sheet Range PasteSpecial function.

You might need to learn more and above piece of code will not do the work youre asking for. I am expecting you to put some effort into programming this aswell.