Consolidating data from many sheets into one sheet

Andy0311

Board Regular
Joined
Oct 16, 2019
Messages
118
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello,

I need help consolidating data from a workbook with 31 tabs (individual staff members). The tab reports seat times online for teachers. Below is a sample tab. The sheet columns are shown in blue. The rows beneath the headers can vary wildly by teacher. I run some code and get a number showing unique days online for the teacher. It's in red and always located in H4 regardless of the tab. I would like to list each of the values in H4 on a separate worksheet in this workbook. I would then be able to take this list and insert it into a master report. Any help would be appreciated. A



BC D EFGH
3
TeacherCourseDateTime(hh:mm)IP AddressUnique Days
Teacher Name
*Home Page/eMail/Forum10/27/20190:02184.58.42.5810/27/2019
LANG Spanish II (19-36)10/27/20190:06184.58.42.5810/30/2019
*Home Page/eMail/Forum10/27/20190:00184.58.42.5811/4/2019
LANG Spanish II (19-36)10/27/20190:02184.58.42.58
*Home Page/eMail/Forum10/27/20190:01184.58.42.58
LANG Spanish II (19-36)10/27/20190:09184.58.42.58
*Home Page/eMail/Forum10/27/20190:00184.58.42.58
LANG Spanish II (19-36)10/27/20190:01184.58.42.58
*Home Page/eMail/Forum10/30/20190:00216.48.134.139
*Home Page/eMail/Forum11/4/20190:00216.48.135.139
Total0:21

<tbody>
</tbody>
</pre>
 
I am baffled. In my test setup, I get the list created with sheet name in column A and values in column B. My test setup consists of three sheets with values in cell H4, the code is run from module1 of the same workbook.

Is the data in your worksheets in a named table?
 
Last edited:
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I am baffled. In my test setup, I get the list created with sheet name in column A and values in column B. My test setup consists of three sheets with values in cell H4, the code is run from module1 of the same workbook.

Is the data in your worksheets in a named table?

No. My worksheet data is not in a named table. A
 
Upvote 0
Well, I am at a loss as to why the values are not showing in column B. Can you copy the code from your code module and paste it intothe 'Reply' pane so I can see if there is a difference between that code and my post # 3 code?
 
Last edited:
Upvote 0
Well, I am at a loss as to why the values are not showing in column B. Can you copy the code from your code module and paste it intothe 'Reply' pane so I can see if there is a difference between that code and my post # 3 code?


I will do that. Thanks.
 
Upvote 0
Well, I am at a loss as to why the values are not showing in column B. Can you copy the code from your code module and paste it intothe 'Reply' pane so I can see if there is a difference between that code and my post # 3 code?


Here's the code:

Code:
Sub t()
Dim sh As Worksheet, ws As Worksheet
Set sh = Sheets.Add
    For Each ws In ThisWorkbook.Sheets
        If ws.Name <> sh.Name Then
            sh.Cells(Rows.Count, 1).End(xlUp)(2) = ws.Name
            sh.Cells(Rows.Count, 1).End(xlUp).Offset(, 1) = ws.Range("H4").Value
        End If
    Next
End Sub
[code]

I run it from the first tab (Worksheet1). Thanks again for your help. A
 
Upvote 0
I just ran a test with six sheets. It returned "Sheet1" in A2 on Sheet7. Nothing else. Thanks.
 
Upvote 0
I just ran a test with six sheets. It returned "Sheet1" in A2 on Sheet7. Nothing else. Thanks.

The code should be installed in a public module like module1, but I ran it from sheet1 of my file and it worked OK. I have no idea why it is not working for you and I cannot duplicate the results you are getting, so I will disconnect from this thread and let somebody else smarter than me try to help you.
Regards, JLG
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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