VBA to pull together data from multiple worksheets by name and column heading

Dex_Excel

New Member
Joined
Jul 12, 2017
Messages
1
Hi, Im currently looking to to create a macro that will pull together entries from multiple worksheets and paste them into a single table on my main worksheets. This involves matching the names in column A to the names on worksheets for each month and matching the correct monthly value based on the headers above.

eg. the output is a table like so with every end of working week and colleague

Colleague7/7/1714/7/1721/7/17
A
B
C
D

<tbody>
</tbody>

<colgroup><col><col span="4"></colgroup><tbody>
</tbody>
and the data itself is split across similar tables on multiple worksheets

My current code is just manually copying each row and pasting it like so with repeats of the same code for each individual

Sub report1()
'
' report1 Macro
' gathering rag statuses
'Application.ScreenUpdating = False
Sheets("July 2017").Select
Range("G50:J50").Select
Selection.Copy
Sheets("Sheet2").Select
Range("B19").Select
ActiveSheet.Paste
Sheets("August 2017").Select
Range("G50:J50").Select
Selection.Copy
Sheets("Sheet2").Select
Range("F19").Select
ActiveSheet.Paste
Sheets("September 2017").Select
Range("G50:K50").Select
Selection.Copy
Sheets("Sheet2").Select
Range("J19").Select
ActiveSheet.Paste
Sheets("October 2017").Select
Range("G50:J50").Select
Selection.Copy
Sheets("Sheet2").Select
Range("O19").Select
ActiveSheet.Paste
Sheets("November 2017").Select
Range("G50:J50").Select
Selection.Copy
Sheets("Sheet2").Select
Range("S19").Select
ActiveSheet.Paste
Sheets("December 2017").Select
Range("G50:K50").Select
Selection.Copy
Sheets("Sheet2").Select
Range("W19").Select
ActiveSheet.Paste
Range("B4:AA19").Select
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Forum statistics

Threads
1,216,210
Messages
6,129,525
Members
449,515
Latest member
lukaderanged

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