Copying Specific Data Selection to new sheets

Closed
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
How can I select entire rows based on a specific value found in a column via a macro when the occurence of the specific value is variable?

eg. My column of interest is customer. I want to select every row that has value of 2 for the column customer, then copy and paste this to a new sheet. I cant specify a reference area because the occurence of customer =2 is variable, it may be 20 records or 50 records.
What function / macro code can I use to accomplish this selection?

In bellow example I would have 3 new sheets created with 2 rows copied on the first, 4 on the second, and 4 on the fifth. (2 records with customer #2, 4 records with customer #3, and 4 records with customer #5)

Customer
2
2
3
3
3
3
5
5
5
5

All help is much appreciated!!

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768