Applying algorithm to excel

Zoochie

New Member
Joined
Mar 3, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi everyone. I currently have an excel sheet that contains rows with very similar data.

I would like to delete the rows if they contain the same first name, last name, DOB and category AND if columns x, y or z does not contain data.

otherwise I want to keep the row.

My knowledge is very weak when it comes to VBA and would appreciate some help. Below is my pseudo code and an example pic of the worksheet.

excel example.PNG

savedRow = row 2;
while savedRow is less than rows with data {
starting from savedRow+1, loop for n rows as long as they contain data {
IF columns B,C,D and M have matching data to savedRow {
IF columns X,Y or Z contains data {
proceed to next row;
}
ELSE {
delete current row;
proceed to next row;
}
}
ELSE { // if b,c,d,m does not match
proceed to next row;
}
} //end of inner loop
savedRow = savedRow + 1;
} //end of outer while loop
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,215,065
Messages
6,122,944
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top