Hi! I am not expert to do macro in excel but hoping someone out there could help me with the formula. I have two worksheets:
Sheet1 - raw data
Sheet2 - enrollment report
The button that has the macro formula is in the Sheet1. Once i click the button, the macro will run with first condition that if row B2 in Sheet1 has value, it should copy row B2 to X2 and paste it to second row (after the header) of Sheet2. But if none, it should check the next row and run the formula and goes on.
Next condition is that, if row Y2 (Do you wish to enroll another dependent (3rd, in the hierarchy line)?:Enrollment Details) is equal to 'Yes', it should copy row B2 to N2 and row AA2 to AI2. This same goes for row AJ2, AU2, BF2, BQ2, and CB2. But if the answer is 'No' or has no value, it will check the next row in Sheet1 then run again the same copy formula until the last row.
I have attached here a sample of my excel file. Hope this will helps. And really hoping someone could help me. Thanks!
Sheet2:
Sheet1:
Sheet1 - raw data
Sheet2 - enrollment report
The button that has the macro formula is in the Sheet1. Once i click the button, the macro will run with first condition that if row B2 in Sheet1 has value, it should copy row B2 to X2 and paste it to second row (after the header) of Sheet2. But if none, it should check the next row and run the formula and goes on.
Next condition is that, if row Y2 (Do you wish to enroll another dependent (3rd, in the hierarchy line)?:Enrollment Details) is equal to 'Yes', it should copy row B2 to N2 and row AA2 to AI2. This same goes for row AJ2, AU2, BF2, BQ2, and CB2. But if the answer is 'No' or has no value, it will check the next row in Sheet1 then run again the same copy formula until the last row.
I have attached here a sample of my excel file. Hope this will helps. And really hoping someone could help me. Thanks!
Sheet2:
sample report.xlsx | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | |||
1 | Employee Number | Employee Last Name | Employee Given Name | Employee Middle Name | Employee M.I | Employee Ext (Jr., II, etc.) | Employee Civil Status | Enrollment Classification | Benefit Plan | Enrollment Eligibilities | Dependent Last Name | Dependent Given Name | Dependent Middle Name | Dependent M.I | Dependent Ext. (Jr., II, etc.) | Relationship | Dependent Date of Birth | Dependent Sex | Dependent Civil Status | ||
2 | 1234 | Alivarez | Ranz | Angelesi | A | Single | Dependents of Supervisor | Specialist | Regular Private | P 250,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Alivarez | Fazima | Angelesi | A | Mother | 10/14/1966 | Female | Married | ||||
3 | 1234 | Alivarez | Ranz | Angelesi | A | Single | Dependents of Supervisor | Specialist | Regular Private | P 250,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Alivarez | Mia Fortuna | Angelesi | A | Sister | 1/5/2004 | Female | Single | ||||
4 | 2468 | Nablos | Vincent | Guccena | G | Single | Dependents of Supervisor | Specialist | Regular Private | P 150,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Nablos | Asunciona | Guccena | G | Mother | 8/14/1969 | Female | Widow/Widower | ||||
5 | 3690 | Jordan | Danvie | Lucena | B | Single | Dependents of Supervisor | Specialist | Regular Private | 150,000.00 | |||||||||||||
6 | 1089 | Maharlika | Dhannie Emo | May | Z | Single | Dependents of Expert | Manager | Regular Private | 450,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Maharlika | Seanti | Deanna | D | Father | 4/25/1958 | Male | Married | ||||
7 | 1089 | Maharlika | Dhannie Emo | May | Z | Single | Dependents of Expert | Manager | Regular Private | 450,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Maharlika | Dharling Erika | May | Z | Sister | 5/4/2013 | Female | Single | ||||
8 | 1089 | Maharlika | Dhannie Emo | May | Z | Single | Dependents of Expert | Manager | Regular Private | 450,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Maharlika | Dhannica Marie | May | Z | Sister | 5/4/2006 | Female | Single | ||||
enrollment report format |
sample report.xlsx | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | |||
1 | Employee Number | Employee Last Name | Employee Given Name | Employee Middle Name | Employee M.I | Employee Ext (Jr., II, etc.) | Employee Civil Status | Enrollment Classification | Benefit Plan | Enrollment Eligibilities | Dependent Last Name | Dependent Given Name | Dependent Middle Name | Dependent M.I | Dependent Ext. (Jr., II, etc.) | Relationship | Dependent Date of Birth | Dependent Sex | Dependent Civil Status | ||
2 | 1234 | Alivarez | Ranz | Angelesi | A | Single | Dependents of Supervisor | Specialist | Regular Private | P 250,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Alivarez | Fazima | Angelesi | A | Mother | 10/14/1966 | Female | Married | ||||
3 | 1234 | Alivarez | Ranz | Angelesi | A | Single | Dependents of Supervisor | Specialist | Regular Private | P 250,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Alivarez | Mia Fortuna | Angelesi | A | Sister | 1/5/2004 | Female | Single | ||||
4 | 2468 | Nablos | Vincent | Guccena | G | Single | Dependents of Supervisor | Specialist | Regular Private | P 150,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Nablos | Asunciona | Guccena | G | Mother | 8/14/1969 | Female | Widow/Widower | ||||
5 | 3690 | Jordan | Danvie | Lucena | B | Single | Dependents of Supervisor | Specialist | Regular Private | 150,000.00 | |||||||||||||
6 | 1089 | Maharlika | Dhannie Emo | May | Z | Single | Dependents of Expert | Manager | Regular Private | 450,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Maharlika | Seanti | Deanna | D | Father | 4/25/1958 | Male | Married | ||||
7 | 1089 | Maharlika | Dhannie Emo | May | Z | Single | Dependents of Expert | Manager | Regular Private | 450,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Maharlika | Dharling Erika | May | Z | Sister | 5/4/2013 | Female | Single | ||||
8 | 1089 | Maharlika | Dhannie Emo | May | Z | Single | Dependents of Expert | Manager | Regular Private | 450,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Maharlika | Dhannica Marie | May | Z | Sister | 5/4/2006 | Female | Single | ||||
enrollment report format |
Sheet1:
Before you proceed to the start with the enrollment of your dependents, we need your acknowledgement that you have carefully read the FY22 Renewal of HMO Services deck and other relevant links to guide you with the entire process. All the links on your email will provide you information about: (a) enhancements in our benefits, (b) the retained annual premium rates to be co-shared with the company, (c) enrollment hierarchy to follow, (d) required supporting documents for new enrollments and the (e) Pre-Termination agreement. HMO Dependent enrollment/ membership is an extension of your benefit as an active and regular employee of the company. Cancellations due to separations will automatically deactivate the membership of your dependent/s' account. Refund is not applicable for separations after more than 6 months of enrollment. If you missed the deck, you may still read and access the link here: FY22 HMO Enrollment Program. Please select applicable response below: | Employee ID Number | Before you proceed to the start with the enrollment of your dependents, we need your acknowledgement that you have carefully read the FY22 Renewal of HMO Services deck and other relevant links to guide you with the entire process. All the links on your email will provide you information about: (a) enhancements in our benefits, (b) the retained annual premium rates to be co-shared with the company, (c) enrollment hierarchy to follow, (d) required supporting documents for new enrollments and the (e) Pre-Termination agreement. HMO Dependent enrollment/ membership is an extension of your benefit as an active and regular employee of the company. Cancellations due to separations will automatically deactivate the membership of your dependent/s' account. Refund is not applicable for separations after more than 6 months of enrollment. If you missed the deck, you may still read and access the link here: FY22 HMO Enrollment Program. Please select applicable response below: | Employee ID Number | Before you proceed to the start with the enrollment of your dependents, we need your acknowledgement that you have carefully read the FY22 Renewal of HMO Services deck and other relevant links to guide you with the entire process. All the links on your email will provide you information about: (a) enhancements in our benefits, (b) the retained annual premium rates to be co-shared with the company, (c) enrollment hierarchy to follow, (d) required supporting documents for new enrollments and the (e) Pre-Termination agreement. HMO Dependent enrollment/ membership is an extension of your benefit as an active and regular employee of the company. Cancellations due to separations will automatically deactivate the membership of your dependent/s' account. Refund is not applicable for separations after more than 6 months of enrollment. If you missed the deck, you may still read and access the link here: FY22 HMO Enrollment Program. Please select applicable response below: | Employee ID Number | Before you proceed to the start with the enrollment of your dependents, we need your acknowledgement that you have carefully read the FY22 Renewal of HMO Services deck and other relevant links to guide you with the entire process. All the links on your email will provide you information about: (a) enhancements in our benefits, (b) the retained annual premium rates to be co-shared with the company, (c) enrollment hierarchy to follow, (d) required supporting documents for new enrollments and the (e) Pre-Termination agreement. HMO Dependent enrollment/ membership is an extension of your benefit as an active and regular employee of the company. Cancellations due to separations will automatically deactivate the membership of your dependent/s' account. Refund is not applicable for separations after more than 6 months of enrollment. If you missed the deck, you may still read and access the link here: FY22 HMO Enrollment Program. Please select applicable response below: | Employee ID Number | Before you proceed to the start with the enrollment of your dependents, we need your acknowledgement that you have carefully read the FY22 Renewal of HMO Services deck and other relevant links to guide you with the entire process. All the links on your email will provide you information about: (a) enhancements in our benefits, (b) the retained annual premium rates to be co-shared with the company, (c) enrollment hierarchy to follow, (d) required supporting documents for new enrollments and the (e) Pre-Termination agreement. HMO Dependent enrollment/ membership is an extension of your benefit as an active and regular employee of the company. Cancellations due to separations will automatically deactivate the membership of your dependent/s' account. Refund is not applicable for separations after more than 6 months of enrollment. If you missed the deck, you may still read and access the link here: FY22 HMO Enrollment Program. Please select applicable response below: | Enrollment Classification(Enrollment classification will determine the available benefit plan options) | Choose a Benefit Plan for your dependents(Remember that you may choose an equal or lower benefit plan) | Choose a Benefit Plan for your dependents(Remember that you may choose an equal or lower benefit plan) | Choose a Benefit Plan for your dependents(Remember that you may choose an equal or lower benefit plan) | Choose a Benefit Plan for your dependents(Remember that you may choose an equal or lower benefit plan) | Enrollment Eligibilities:Enrollment Details | Last Name:Dependent 1:Dependent Information | Given Name:Dependent 1:Dependent Information | Middle Name:Dependent 1:Dependent Information | M.I. to Use:Dependent 1:Dependent Information | Ext. (Jr., II, etc.):Dependent 1:Dependent Information | Relationship:Enrollment Details | Date of Birth:Enrollment Details | Sex:Enrollment Details | Civil Status:Enrollment Details | Do you wish to enroll another dependent (2nd, in the hierarchy line)?:Enrollment Details | Enrollment Eligibilities:Enrollment Details | Last Name:Dependent 2:Dependent Information | Given Name:Dependent 2:Dependent Information | Middle Name:Dependent 2:Dependent Information | M.I. to Use:Dependent 2:Dependent Information | Ext. (Jr., II, etc.):Dependent 2:Dependent Information | Relationship:Enrollment Details | Date of Birth:Enrollment Details | Sex:Enrollment Details | Civil Status:Enrollment Details | Do you wish to enroll another dependent (3rd, in the hierarchy line)?:Enrollment Details | Enrollment Eligibilities:Enrollment Details | Last Name:Dependent 3:Dependent Information | Given Name:Dependent 3:Dependent Information | Middle Name:Dependent 3:Dependent Information | M.I. to Use:Dependent 3:Dependent Information | Ext. (Jr., II, etc.):Dependent 3:Dependent Information | Relationship:Enrollment Details | Date of Birth:Enrollment Details | Sex:Enrollment Details | Civil Status:Enrollment Details | Do you wish to enroll another dependent (4th, in the hierarchy line)?:Enrollment Details | Enrollment Eligibilities:Enrollment Details | Last Name:Dependent 4:Dependent Information | Given Name:Dependent 4:Dependent Information | Middle Name:Dependent 4:Dependent Information | M.I. to Use:Dependent 4:Dependent Information | Ext. (Jr., II, etc.):Dependent 4:Dependent Information | Relationship:Enrollment Details | Date of Birth:Enrollment Details | Sex:Enrollment Details | Civil Status:Enrollment Details | Do you wish to enroll another dependent (5th, in the hierarchy line)?:Enrollment Details | Enrollment Eligibilities:Enrollment Details | Last Name:Dependent 5:Dependent Information | Given Name:Dependent 5:Dependent Information | Middle Name:Dependent 5:Dependent Information | M.I. to Use:Dependent 5:Dependent Information | Ext. (Jr., II, etc.):Dependent 5:Dependent Information | Relationship:Enrollment Details | Date of Birth:Enrollment Details | Sex:Enrollment Details | Civil Status:Enrollment Details | Do you wish to enroll another dependent (6th, in the hierarchy line)?:Enrollment Details | Enrollment Eligibilities:Enrollment Details | Last Name:Dependent 6:Dependent Information | Given Name:Dependent 6:Dependent Information | Middle Name:Dependent 6:Dependent Information | M.I. to Use:Dependent 6:Dependent Information | Ext. (Jr., II, etc.):Dependent 6:Dependent Information | Relationship:Enrollment Details | Date of Birth:Enrollment Details | Sex:Enrollment Details | Civil Status:Enrollment Details | Do you wish to enroll another dependent (7th, in the hierarchy line)? Please email GSMClinic@bakermckenzie.com.:Enrollment Details |
Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 1234 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 1234 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 1234 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 1234 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | Dependents of Supervisor | Specialist | Regular Private | 250,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Alivarez | Fazima | Angelesi | A | Mother | 10/14/1966 | Female | Married | Yes | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Alivarez | Mia Fortuna | Angelesi | A | Sister | 1/5/2004 | Female | Single | No | |||||||||||||||||||||||||||||||||||||||||||||||||
Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 2468 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 2468 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 2468 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 2468 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | Dependents of Supervisor | Specialist | Regular Private | 150,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Nablos | Asunciona | Guccena | G | Mother | 8/14/2021 | Female | Widow/Widower | No | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 3690 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 3690 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 3690 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 3690 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | Dependents of Supervisor | Specialist | Regular Private | 150,000.00 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 1089 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 1089 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 1089 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | 1089 | Yes - I have read the deck and relevant links about the FY22 HMO Enrollment Program. | Dependents of Supervisor | Specialist | Regular Private | 350,000.00 | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Maharlika | Seanti | Deanna | D | Father | 4/25/1958 | Male | Married | Yes | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Maharlika | Dharling Erika | May | Z | Sister | 5/4/2013 | Female | Single | Yes | [Immediate Dependent] Single, enrolling parent/s, child/ren and siblings | Maharlika | Dhannica Marie | May | Z | Sister | 5/4/2006 | Female | Single | No |