Combining cells from multiple worksheets into rows on single worksheet

aktheexcelguy

New Member
Joined
Sep 19, 2019
Messages
3
Hi, I am hoping someone is able to help me. I have a workbook with about 300 tabs. All exactly the same format. I am trying to write a macro that copies all of the data from several cells in each workbook into a single workbook. Let me give more an example.

A1 - First Name
B1 - Last Name
C1 - Phone Number

Result:

Worksheet - Collated
A1 - FIRST NAME
B1 - FIRST NAME
C1 - PHONE NUMBER
NEXT ROW WILL PULL FROM NEXT SHEET
A2 - FIRST NAME
B2 - LAST NAME
C2 - PHONE NUMBER
NEXT ROW WILL PULL FROM THE NEXT SHEET
A3 - FIRST NAME

and so on.

Please someone help explain to me how to do this. I am really stuck.
 
I'll put this up and the OP can adjust the range to suit.
But I'm willing to bet there is more to this than we see here, it'll get MUCH bigger...:lol:

Code:
Sub MM1()
Dim ws As Worksheet, c As Range, dest As Range, lr As Long
lr = Sheets("Master").Cells(Rows.Count, "A").End(xlUp).Row
For Each ws In Worksheets
    If ws.Name <> "Master" Then
    Set dest = Sheets("Master").Range("A" & lr)
        For Each c In ws.Range("A1, B23, C12")
                dest.Value = c.Value
                Set dest = dest.Offset(0, 1)
        Next c
    End If
lr = lr + 1
Next ws
End Sub


This worked an absolute treat. Thank you very much. I had an assets and liabilites documents for a couple of hundred clients, each of which was a new worksheet. It was incredibly painful. Once I entered in all of the cells into the range above, it generated the results within seconds. Amazing. Thank you for all of your help everybody.
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
That's probably the best "Guess" I have ever had....:lol:
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top