I am new to this forum and I would be very thankful if anyone can help me out.
I need a code that will copy certain cells from all sheets of all files in a folder and then list/paste them down in another master/summary sheet.
All workbooks in the folder have multiple sheets and in each sheet the cells which I want to copy are A2. B2 and C2
Example :
In work -Book1
Sheet 1
<tbody>
</tbody>
Sheet 2
<tbody>
</tbody>
Sheet 3
<tbody>
</tbody>
In work Book-2
Sheet 1
<tbody>
</tbody>
Sheet 2
<tbody>
</tbody>
Sheet 3
<tbody>
</tbody>
And so on.
I want to compile the highlighted cells in the following format in the summary file.
<tbody>
</tbody>
Any help would be appreciated. I have searched the internet for this and have found the following links but I wasn’t able to make them work.
http://www.mrexcel.com/forum/excel-questions/673353-macro-copy-data-multiple-excel-files.html
http://www.mrexcel.com/forum/excel-questions/508186-loop-through-folder-run-macro-all-workbooks.html
The following code does what I want for 1 workbook only
Sub Button10_Click()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Select
'Sub CopyData()
With ActiveSheet
.Range("A2").Select
Selection.Copy
Sheets("Proof Sheet").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
.Range("B2").Select
Selection.Copy
Sheets("Proof Sheet").Range("B" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
.Range("C2").Select
Selection.Copy
Sheets("Proof Sheet").Range("C" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
End With
Application.ScreenUpdating = False
Next
Application.ScreenUpdating = False
Sheets("Proof Sheet").Select
End Sub
I can provide futher details if needed
thanks in advance
I need a code that will copy certain cells from all sheets of all files in a folder and then list/paste them down in another master/summary sheet.
All workbooks in the folder have multiple sheets and in each sheet the cells which I want to copy are A2. B2 and C2
Example :
In work -Book1
Sheet 1
A | B | C | |
1 | CODE | PAGE | BALANCE |
2 | 47401 | ABC-1 | 12345678 |
<tbody>
</tbody>
Sheet 2
A | B | C | |
1 | CODE | PAGE | BALANCE |
2 | 47402 | ABC-2 | 51354351 |
<tbody>
</tbody>
Sheet 3
A | B | C | |
1 | CODE | PAGE | BALANCE |
2 | 47403 | ABC-3 | 54542545 |
<tbody>
</tbody>
In work Book-2
Sheet 1
A | B | C | |
1 | CODE | PAGE | BALANCE |
2 | 37601 | xyz-1 | 12345678 |
<tbody>
</tbody>
Sheet 2
A | B | C | |
1 | CODE | PAGE | BALANCE |
2 | 37602 | xyz-2 | 51354351 |
<tbody>
</tbody>
Sheet 3
A | B | C | |
1 | CODE | PAGE | BALANCE |
2 | 37603 | xyz-3 | 54542545 |
<tbody>
</tbody>
And so on.
I want to compile the highlighted cells in the following format in the summary file.
A | B | C | |
1 | CODE | PAGE | BALANCE |
2 | 47401 | ABC-1 | 12,345,678 |
3 | 47402 | ABC-2 | 51,354,351 |
4 | 47403 | ABC-3 | 54,542,545 |
5 | 37601 | xyz-1 | 12,345,678 |
6 | 37601 | xyz-2 | 51,354,351 |
7 | 37603 | xyz-3 | 54,542,545 |
<tbody>
</tbody>
Any help would be appreciated. I have searched the internet for this and have found the following links but I wasn’t able to make them work.
http://www.mrexcel.com/forum/excel-questions/673353-macro-copy-data-multiple-excel-files.html
http://www.mrexcel.com/forum/excel-questions/508186-loop-through-folder-run-macro-all-workbooks.html
The following code does what I want for 1 workbook only
Sub Button10_Click()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Select
'Sub CopyData()
With ActiveSheet
.Range("A2").Select
Selection.Copy
Sheets("Proof Sheet").Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
.Range("B2").Select
Selection.Copy
Sheets("Proof Sheet").Range("B" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
.Range("C2").Select
Selection.Copy
Sheets("Proof Sheet").Range("C" & Rows.Count).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
End With
Application.ScreenUpdating = False
Next
Application.ScreenUpdating = False
Sheets("Proof Sheet").Select
End Sub
I can provide futher details if needed
thanks in advance