Home

Extract data from multiple sheet into one with conditions

%3CLINGO-SUB%20id%3D%22lingo-sub-871110%22%20slang%3D%22en-US%22%3EExtract%20data%20from%20multiple%20sheet%20into%20one%20with%20conditions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-871110%22%20slang%3D%22en-US%22%3E%3CP%3EI%20work%20as%20a%20teacher%20and%20I%20have%20a%20cumulative%20timetable%20with%20all%20subjects%2C%20a%20single%20sheet%20for%20each%20class.%20So%2C%20for%20each%20class%20I%20have%20each%20day%20of%20the%20year%20with%20the%20relative%20timetable%20(there%20are%20several%20changes%20from%20week%20to%20week).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'd%20like%20to%20extract%20my%20complete%20timetable%20to%20have%20it%20in%20a%20single%20sheet%20and%20be%20able%20to%20see%20quickly%20where%20I%20have%20a%20lesson.%20How%20can%20I%20do%20it%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20see%20an%20example%20of%20the%20file%20in%20the%20attached.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-871110%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExtract%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-871361%22%20slang%3D%22en-US%22%3ERe%3A%20Extract%20data%20from%20multiple%20sheet%20into%20one%20with%20conditions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-871361%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F413897%22%20target%3D%22_blank%22%3E%40TheCarb1%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20find%20the%20attached%20with%20a%20code%20called%20%3CSTRONG%3EGetTimeTableSummary%3C%2FSTRONG%3E%20on%20Module1.%20There%20is%20also%20a%20Class%20Module%20named%20%3CSTRONG%3EclsTimeTable%3C%2FSTRONG%3E%20with%20some%20public%20variables.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20to%20implement%20the%20codes%20to%20your%20original%20workbook%2C%20you%20will%20be%20required%20to%20copy%20both%20the%20Module1%20and%20clsTimeTable%20codes%20to%20your%20workbook.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20codes%20assume%20that%20in%20your%20file%2C%20the%20name%20of%20all%20the%20Class%20Sheets%20starts%20from%20CLASS%20and%20will%20create%20a%20Summary%20Tab%20with%20all%20the%20data%20from%20the%20CLASS%20Sheets%20sorted%20by%20Date%20and%20Start%20Time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20will%20also%20find%20a%20button%20called%20%3CSTRONG%3ECreate%20Summary%3C%2FSTRONG%3E%20on%20CLASS%201%20Sheet%2C%20you%20may%20click%20this%20button%20to%20run%20the%20code.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20may%20also%20run%20the%20code%20by%20pressing%20a%20shortcut%20key%20%3CSTRONG%3ECtrl%2BShift%2BR%3C%2FSTRONG%3E%20to%20create%20the%20Summary.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ESub%20GetTimeTableSummary()%0ADim%20ws%20%20%20%20%20%20%20%20%20%20As%20Worksheet%0ADim%20wsSummary%20%20%20As%20Worksheet%0ADim%20tb%20%20%20%20%20%20%20%20%20%20As%20clsTimeTable%0ADim%20x%20%20%20%20%20%20%20%20%20%20%20As%20Variant%0ADim%20Coll%20%20%20%20%20%20%20%20As%20New%20Collection%0ADim%20i%20%20%20%20%20%20%20%20%20%20%20As%20Long%0ADim%20j%20%20%20%20%20%20%20%20%20%20%20As%20Long%0ADim%20r%20%20%20%20%20%20%20%20%20%20%20As%20Long%0ADim%20strTime%20%20%20%20%20As%20String%0A%0AApplication.ScreenUpdating%20%3D%20False%0A%0AFor%20Each%20ws%20In%20ThisWorkbook.Worksheets%0A%20%20%20%20If%20ws.Name%20Like%20%22CLASS*%22%20Then%0A%20%20%20%20%20%20%20%20x%20%3D%20ws.Range(%22A1%22).CurrentRegion.Value%0A%20%20%20%20%20%20%20%20For%20i%20%3D%202%20To%20UBound(x%2C%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20For%20j%20%3D%204%20To%20UBound(x%2C%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20If%20x(i%2C%20j)%20%26lt%3B%26gt%3B%20%22%22%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20strTime%20%3D%20x(1%2C%20j)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Set%20tb%20%3D%20New%20clsTimeTable%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tb.Period_Date%20%3D%20x(i%2C%201)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tb.Period_Day%20%3D%20x(i%2C%202)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tb.period_Hours%20%3D%20x(i%2C%203)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tb.StartTime%20%3D%20Replace(Split(strTime%2C%20%22-%22)(0)%2C%20%22.%22%2C%20%22%3A%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tb.EndTime%20%3D%20Replace(Split(strTime%2C%20%22-%22)(1)%2C%20%22.%22%2C%20%22%3A%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tb.Subject%20%3D%20x(i%2C%20j)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20tb.ClassName%20%3D%20ws.Name%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Coll.Add%20tb%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20%20%20%20%20Next%20j%0A%20%20%20%20%20%20%20%20Next%20i%0A%20%20%20%20End%20If%0ANext%20ws%0A%0AOn%20Error%20Resume%20Next%0ASet%20wsSummary%20%3D%20Worksheets(%22Summary%22)%0AwsSummary.Cells.Clear%0AOn%20Error%20GoTo%200%0A%0AIf%20wsSummary%20Is%20Nothing%20Then%0A%20%20%20%20Set%20wsSummary%20%3D%20Worksheets.Add(before%3A%3DWorksheets(1))%0A%20%20%20%20wsSummary.Name%20%3D%20%22Summary%22%0AEnd%20If%0A%0AwsSummary.Range(%22A1%3AG1%22).Value%20%3D%20Array(%22Date%22%2C%20%22Day%22%2C%20%22Start%20Time%22%2C%20%22End%20Time%22%2C%20%22Hours%22%2C%20%22Subject%22%2C%20%22Class%22)%0A%0Ar%20%3D%202%0A%0AFor%20i%20%3D%201%20To%20Coll.Count%0A%20%20%20%20Set%20tb%20%3D%20Coll(i)%0A%20%20%20%20wsSummary.Cells(r%2C%201)%20%3D%20tb.Period_Date%0A%20%20%20%20wsSummary.Cells(r%2C%202)%20%3D%20tb.Period_Day%0A%20%20%20%20wsSummary.Cells(r%2C%203)%20%3D%20tb.StartTime%0A%20%20%20%20wsSummary.Cells(r%2C%204)%20%3D%20tb.EndTime%0A%20%20%20%20wsSummary.Cells(r%2C%205)%20%3D%20tb.period_Hours%0A%20%20%20%20wsSummary.Cells(r%2C%206)%20%3D%20tb.Subject%0A%20%20%20%20wsSummary.Cells(r%2C%207)%20%3D%20tb.ClassName%0A%20%20%20%20r%20%3D%20r%20%2B%201%0ANext%20i%0AWith%20wsSummary%0A%20%20%20%20.Range(%22A1%22).CurrentRegion.Sort%20key1%3A%3DwsSummary.Range(%22A2%22)%2C%20order1%3A%3DxlAscending%2C%20key2%3A%3DwsSummary.Range(%22C2%22)%2C%20order2%3A%3DxlAscending%2C%20Header%3A%3DxlYes%0A%20%20%20%20%0A%20%20%20%20With%20.Range(%22A1%22).CurrentRegion%0A%20%20%20%20%20%20%20%20.Offset(1).FormatConditions.Add%20Type%3A%3DxlExpression%2C%20Formula1%3A%3D%20_%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%3DAND(%24A2%26lt%3B%26gt%3B%22%22%22%22%2CMOD(SUM(--(FREQUENCY(%24A%242%3A%24A2%2C%24A%242%3A%24A2)%26gt%3B0))%2C2)%3D1)%22%0A%20%20%20%20%20%20%20%20.Offset(1).FormatConditions(1).Interior.Color%20%3D%20RGB(242%2C%20242%2C%20242)%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20.Offset(1).FormatConditions.Add%20Type%3A%3DxlExpression%2C%20Formula1%3A%3D%20_%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%3DAND(%24A2%26lt%3B%26gt%3B%22%22%22%22%2CMOD(SUM(--(FREQUENCY(%24A%242%3A%24A2%2C%24A%242%3A%24A2)%26gt%3B0))%2C2)%3D0)%22%0A%20%20%20%20%20%20%20%20.Offset(1).FormatConditions(2).Interior.Color%20%3D%20RGB(221%2C%20235%2C%20247)%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20.Borders.Color%20%3D%20vbBlack%0A%20%20%20%20%20%20%20%20.AutoFilter%0A%20%20%20%20End%20With%0A%20%20%20%20.Rows(1).Font.Bold%20%3D%20True%0A%20%20%20%20.UsedRange.Columns.AutoFit%0A%20%20%20%20.Select%0AEnd%20With%0A%0AApplication.ScreenUpdating%20%3D%20True%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20know%20if%20this%20is%20what%20you%20were%20trying%20to%20achieve.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-871518%22%20slang%3D%22en-US%22%3ERe%3A%20Extract%20data%20from%20multiple%20sheet%20into%20one%20with%20conditions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-871518%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20a%20lot%20for%20your%20quick%20reply.%3C%2FP%3E%3CP%3EI%20copied%20data%20on%20the%20sheet%20you%20made%20to%20be%20sure%20everything%20worked%20but%20I%20got%20%22Runtime%20error%3A%205%22%20on%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%20%20%20%20%20%20%20%20.Offset(1).FormatConditions.Add%20Type%3A%3DxlExpression%2C%20Formula1%3A%3D%20_%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%3DAND(%24A2%26lt%3B%26gt%3B%22%22%22%22%2CMOD(SUM(--(FREQUENCY(%24A%242%3A%24A2%2C%24A%242%3A%24A2)%26gt%3B0))%2C2)%3D1)%22%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I'd%20really%20want%20to%20achive%20is%20to%20be%20able%20to%20extract%20timetables%20for%20each%20subject.%3C%2FP%3E%3CP%3EI.E.%20if%20I'm%20the%20French%20teacher%2C%20I'd%20like%20to%20be%20able%20to%20see%2C%20for%20each%20class%20obviously%2C%20when%20I%20have%20my%20lesson%3A%20in%20this%20way%20I%20can%20have%20a%20single%20sheet%20with%20all%20French%20lessons%20and%20be%20able%20to%20know%20when%20and%20where%20the%20lessons%20are.%20In%20this%20way%2C%20every%20teacher%20could%20do%20it...%20I%20don't%20know%20if%20I%20explained%20well%20what's%20my%20goal.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20a%20lot%20for%20your%20help!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-871567%22%20slang%3D%22en-US%22%3ERe%3A%20Extract%20data%20from%20multiple%20sheet%20into%20one%20with%20conditions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-871567%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F413897%22%20target%3D%22_blank%22%3E%40TheCarb1%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOkay%2C%20I%20have%20changed%20the%20approach.%3C%2FP%3E%3CP%3ENow%20I%20have%20inserted%20a%20Sheet%20called%20%22Subject%20List%22%20with%20the%20list%20of%20Subjects%20which%20appears%20on%20your%20CLASS%20Sheets%20and%20you%20should%20do%20the%20same%20as%20well.%20Make%20sure%20the%20Subjects%20listed%20in%20Subject%20List%20Sheet%20exactly%20match%20with%20the%20Subjects%20on%20CLASS%20Sheets.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20placed%20a%26nbsp%3BWorksheet_BeforeDoubleClick%20Event%20Code%20on%20Subject%20List%20Sheet%20Module%20so%20that%20once%20you%20have%20a%20list%20of%20Subjects%20in%20Column%20A%20on%20Subject%20List%20Tab%2C%20you%20may%20double%20click%20on%20any%20Subject%20and%20the%20Summary%20Sheet%20for%20all%20the%20records%20which%20belong%20to%20that%20Subject%20would%20appear.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20test%20the%20code%2C%20go%20to%20Subject%20List%20Sheet%20and%20double%20click%20in%20any%20cell%20with%20a%20Subject%20in%20Column%20A.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELet%20me%20know%20if%20that%20works%20for%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-872115%22%20slang%3D%22en-US%22%3ERe%3A%20Extract%20data%20from%20multiple%20sheet%20into%20one%20with%20conditions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-872115%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20easiest%20way%20is%20to%20use%20Power%20Query.%20I%20have%20attached%20the%20file%20you%20have%20provided.%20When%20you%20check%20it%20you%20will%20see%20two%20tables%20Schedule_1%20and%20Schedule_2.%20this%20is%20important%20as%20if%20you%20need%20to%20add%20new%20data%20you%20need%20to%20insert%20a%20new%20table%20with%20a%20name%20starting%20with%20Schedule.%20And%20when%20you%20refres%20the%20query%20you%20wil%20have%20all%20the%20data%20in%20the%20table.%20then%20you%20can%20easily%20filter%20it%20from%20the%20final%20table.%20or%20you%20can%20filter%20it%20in%20the%20query.%3C%2FP%3E%3CP%3ENote%3A%20I%20have%20used%20Excel%202016%20for%20this%20so%20if%20you%20have%20a%20newer%20version%2C%20you%20should%20have%20no%20problem%20with%20it.%20%C4%B0f%20you%20have%20Excel%202010%20or%202013%20you%20need%20to%20install%20power%20query.%20%C4%B0t%20is%20free%20and%20can%20be%20downloaded%20from%20Microsoft%20site.%3C%2FP%3E%3C%2FLINGO-BODY%3E
TheCarb1
New Contributor

I work as a teacher and I have a cumulative timetable with all subjects, a single sheet for each class. So, for each class I have each day of the year with the relative timetable (there are several changes from week to week).

 

I'd like to extract my complete timetable to have it in a single sheet and be able to see quickly where I have a lesson. How can I do it?

 

You can see an example of the file in the attached.

 

Thanks for your help

4 Replies

@TheCarb1 

Please find the attached with a code called GetTimeTableSummary on Module1. There is also a Class Module named clsTimeTable with some public variables.

 

If you have to implement the codes to your original workbook, you will be required to copy both the Module1 and clsTimeTable codes to your workbook.

 

The codes assume that in your file, the name of all the Class Sheets starts from CLASS and will create a Summary Tab with all the data from the CLASS Sheets sorted by Date and Start Time.

 

You will also find a button called Create Summary on CLASS 1 Sheet, you may click this button to run the code.

 

You may also run the code by pressing a shortcut key Ctrl+Shift+R to create the Summary.

 

Sub GetTimeTableSummary()
Dim ws          As Worksheet
Dim wsSummary   As Worksheet
Dim tb          As clsTimeTable
Dim x           As Variant
Dim Coll        As New Collection
Dim i           As Long
Dim j           As Long
Dim r           As Long
Dim strTime     As String

Application.ScreenUpdating = False

For Each ws In ThisWorkbook.Worksheets
    If ws.Name Like "CLASS*" Then
        x = ws.Range("A1").CurrentRegion.Value
        For i = 2 To UBound(x, 1)
            For j = 4 To UBound(x, 2)
                If x(i, j) <> "" Then
                    strTime = x(1, j)
                    Set tb = New clsTimeTable
                    tb.Period_Date = x(i, 1)
                    tb.Period_Day = x(i, 2)
                    tb.period_Hours = x(i, 3)
                    tb.StartTime = Replace(Split(strTime, "-")(0), ".", ":")
                    tb.EndTime = Replace(Split(strTime, "-")(1), ".", ":")
                    tb.Subject = x(i, j)
                    tb.ClassName = ws.Name
                    Coll.Add tb
                End If
            Next j
        Next i
    End If
Next ws

On Error Resume Next
Set wsSummary = Worksheets("Summary")
wsSummary.Cells.Clear
On Error GoTo 0

If wsSummary Is Nothing Then
    Set wsSummary = Worksheets.Add(before:=Worksheets(1))
    wsSummary.Name = "Summary"
End If

wsSummary.Range("A1:G1").Value = Array("Date", "Day", "Start Time", "End Time", "Hours", "Subject", "Class")

r = 2

For i = 1 To Coll.Count
    Set tb = Coll(i)
    wsSummary.Cells(r, 1) = tb.Period_Date
    wsSummary.Cells(r, 2) = tb.Period_Day
    wsSummary.Cells(r, 3) = tb.StartTime
    wsSummary.Cells(r, 4) = tb.EndTime
    wsSummary.Cells(r, 5) = tb.period_Hours
    wsSummary.Cells(r, 6) = tb.Subject
    wsSummary.Cells(r, 7) = tb.ClassName
    r = r + 1
Next i
With wsSummary
    .Range("A1").CurrentRegion.Sort key1:=wsSummary.Range("A2"), order1:=xlAscending, key2:=wsSummary.Range("C2"), order2:=xlAscending, Header:=xlYes
    
    With .Range("A1").CurrentRegion
        .Offset(1).FormatConditions.Add Type:=xlExpression, Formula1:= _
            "=AND($A2<>"""",MOD(SUM(--(FREQUENCY($A$2:$A2,$A$2:$A2)>0)),2)=1)"
        .Offset(1).FormatConditions(1).Interior.Color = RGB(242, 242, 242)
        
        .Offset(1).FormatConditions.Add Type:=xlExpression, Formula1:= _
            "=AND($A2<>"""",MOD(SUM(--(FREQUENCY($A$2:$A2,$A$2:$A2)>0)),2)=0)"
        .Offset(1).FormatConditions(2).Interior.Color = RGB(221, 235, 247)
        
        .Borders.Color = vbBlack
        .AutoFilter
    End With
    .Rows(1).Font.Bold = True
    .UsedRange.Columns.AutoFit
    .Select
End With

Application.ScreenUpdating = True
End Sub

 

Let me know if this is what you were trying to achieve.

 

 

 

@Subodh_Tiwari_sktneer 

Thanks a lot for your quick reply.

I copied data on the sheet you made to be sure everything worked but I got "Runtime error: 5" on

 

        .Offset(1).FormatConditions.Add Type:=xlExpression, Formula1:= _
            "=AND($A2<>"""",MOD(SUM(--(FREQUENCY($A$2:$A2,$A$2:$A2)>0)),2)=1)"

 

 

What I'd really want to achive is to be able to extract timetables for each subject.

I.E. if I'm the French teacher, I'd like to be able to see, for each class obviously, when I have my lesson: in this way I can have a single sheet with all French lessons and be able to know when and where the lessons are. In this way, every teacher could do it... I don't know if I explained well what's my goal.

 

Thanks a lot for your help!

@TheCarb1 

Okay, I have changed the approach.

Now I have inserted a Sheet called "Subject List" with the list of Subjects which appears on your CLASS Sheets and you should do the same as well. Make sure the Subjects listed in Subject List Sheet exactly match with the Subjects on CLASS Sheets.

 

I have placed a Worksheet_BeforeDoubleClick Event Code on Subject List Sheet Module so that once you have a list of Subjects in Column A on Subject List Tab, you may double click on any Subject and the Summary Sheet for all the records which belong to that Subject would appear.

 

To test the code, go to Subject List Sheet and double click in any cell with a Subject in Column A.

 

Let me know if that works for you.

 

 

@Subodh_Tiwari_sktneer 

The easiest way is to use Power Query. I have attached the file you have provided. When you check it you will see two tables Schedule_1 and Schedule_2. this is important as if you need to add new data you need to insert a new table with a name starting with Schedule. And when you refres the query you wil have all the data in the table. then you can easily filter it from the final table. or you can filter it in the query.

Note: I have used Excel 2016 for this so if you have a newer version, you should have no problem with it. İf you have Excel 2010 or 2013 you need to install power query. İt is free and can be downloaded from Microsoft site.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies