Consolidate Data from 30 workbook tabs

Andy0311

Board Regular
Joined
Oct 16, 2019
Messages
118
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello - I have a workbook which contains a report for 30 employees. The reports vary in length. But, the name of the employee and a number (derived from counting)are always in the same cell. The employee's name is always in B5 and the number is always in H4 regardless of the report length. Ideally, rather than going through each tab to get the employee name and the number, I would like to run a script that produces in a new sheet the following:

Amy 12
Joe 15
Cam 15
Jon 13
Max 15

and so forth. ...

The transfer of this data to a master report would be so much easier. Thanks for your help.

Andy
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
How about
VBA Code:
Sub Andy0311()
    Dim Ws As Worksheet
    Dim i As Long
    i = 1
    With Sheets.Add(Sheets(1))
        .Name = "Master"
        For Each Ws In Worksheets
            If Not Ws.Name = .Name Then
                i = i + 1
                .Cells(i, 1) = Ws.Range("B5").Value
                .Cells(i, 2) = Ws.Range("H4").Value
            End If
        Next Ws
    End With
End Sub
 
Upvote 0
Hi Fluff,

Thanks again for your help. I will run this code as soon as I can. I have the rest of the week off and can't wait to get it installed and run. I will get back with the results. Best wishes, and thanks again.

Andy
 
Upvote 0
Look forward to hearing the results :)
 
Upvote 0
Hi Fluff,

I just ran it and it worked flawlessly. Exactly what I need. Another hour saved. Thanks again and again!

Andy
 
Upvote 0
My pleasure & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,420
Messages
6,124,803
Members
449,190
Latest member
cindykay

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