Forum Discussion
Extract data from multiple sheet into one with conditions
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!
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.
- erol sinan zorluSep 24, 2019Iron Contributor
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.