Hi,
I use excel a lot at work and want to start making my job easier. I am trying to learn how to use VBA, but need an answer on this issue sooner than later. I am trying to get data from a report, but I need to delete duplicate records to get accurate information. However, there are some instances where I do need some duplicates if it meets one criteria. My spreadsheet has too much info for me to post it all, so here is an attempt to simplify what it looks like:
Column A (Scheduler) Column B(Course) Column C(Session) Column D(Attendance) Column E(Students)
1 OP1 100 1 Enrolled 3
2 OP1 100 1 Waived 2
3 OP1 100 1 Request 5
4 OP1 101 1 Enrolled 13
5 OP1 101 1 Request 2
6 OP2 200 2 Enrolled 8
7 OP2 200 2 Cancelled 2
8 OP2 200 2 Request 3
So here's what I am looking for:
- I want to delete duplicates and keep one record based on attendance precedence: (1) Enrolled, (2) Waived,(3) Request, (4) Cancelled
- The duplicates should be based on course and session.
- 1,2,3 are duplicates, 4,5 are duplicates, and 6,7,8 are duplicates
- In addition to records with the value "Enrolled," I want to keep any record that also has the value "Waived"
So, my goal is to run a macro (Unless there is a simple task that can do this for me in excel) to make result in the following:
Column A (Scheduler) Column B(Course) Column C(Session) Column D(Attendance) Column E(Students)
1 OP1 100 1 Enrolled 3
2 OP1 100 1 Waived 2
3 OP1 101 1 Enrolled 13
4 OP2 200 2 Enrolled 8
I hope this isn't confusing. Appreciate any assistance!
CGXLuser
I use excel a lot at work and want to start making my job easier. I am trying to learn how to use VBA, but need an answer on this issue sooner than later. I am trying to get data from a report, but I need to delete duplicate records to get accurate information. However, there are some instances where I do need some duplicates if it meets one criteria. My spreadsheet has too much info for me to post it all, so here is an attempt to simplify what it looks like:
Column A (Scheduler) Column B(Course) Column C(Session) Column D(Attendance) Column E(Students)
1 OP1 100 1 Enrolled 3
2 OP1 100 1 Waived 2
3 OP1 100 1 Request 5
4 OP1 101 1 Enrolled 13
5 OP1 101 1 Request 2
6 OP2 200 2 Enrolled 8
7 OP2 200 2 Cancelled 2
8 OP2 200 2 Request 3
So here's what I am looking for:
- I want to delete duplicates and keep one record based on attendance precedence: (1) Enrolled, (2) Waived,(3) Request, (4) Cancelled
- The duplicates should be based on course and session.
- 1,2,3 are duplicates, 4,5 are duplicates, and 6,7,8 are duplicates
- In addition to records with the value "Enrolled," I want to keep any record that also has the value "Waived"
So, my goal is to run a macro (Unless there is a simple task that can do this for me in excel) to make result in the following:
Column A (Scheduler) Column B(Course) Column C(Session) Column D(Attendance) Column E(Students)
1 OP1 100 1 Enrolled 3
2 OP1 100 1 Waived 2
3 OP1 101 1 Enrolled 13
4 OP2 200 2 Enrolled 8
I hope this isn't confusing. Appreciate any assistance!
CGXLuser