Forum Discussion
NotSoFastEddie
Apr 26, 2024Copper Contributor
Best way to segregate certain rows into each of their own worksheet from a primary
What would be the best way to take a single worksheet that contains multiple "record types" and copy them into their own worksheet?
The idea is to take each record type and create a copy of those in this spreadsheet into another. In this example, there would be the main sheet (shown) and 4 new sheets containing each of the rows for a record type. (Pivot table?)
8 Replies
Sort By
- Andrew__KCopper Contributor
NotSoFastEddie you can use FILTER to achieve this.
=FILTER(A1:G11,A1:A11="PCODE")
or below using your table references
=FILTER(TBL_Bouquets,TBL_Bouquets[Record Type]="PCODE")
Repeat on each sheet for each record type.
You could also use Power Query from Table/Range and simply filter by Record Type then load to corresponding sheet.
- NotSoFastEddieCopper ContributorHey Andrew. Thanks very much for this option. It works great and is simple. I already have another use for it. Thanks again.
See the macro in the attached workbook.
I changed the table on the Main sheet to an ordinary range.
- NotSoFastEddieCopper Contributor
HansVogelaar Thanks for the quick response.
I took the VBA and put it into my "official" spreadsheet and ran the macro.
when I run it I receive a failure message on the range sort. Not sure what to do???Line where it died"official" spreadsheetError Received
I initially got that error too.
I had to convert the table in the data to a normal range for the code to work.