I am writing a macro that checks to see if a cell, and the cell directly below it within the same column are the same. So for instance it will start with z2, then compare z2 to z3. Only if z2 and z3 are the same value , then the macro will take the sum of the two corresponding cells in a different column of their respective rows i.e. b2 + b3. Only if b2+b3 equals 0, then i want the macro to delete the rows 2 + 3, then proceed to check if z4 (or z3 if not previously erased) is the same as z5 (or z4 again depending upon scenario) and so forth until the column runs out. My problem is sometimes both rows get deleted - and other times only 1 of the two rows get deleted and i don't know why some are and some aren't.
Code so far. Please be aware I am still a vba novice. Feel free to change my code however you may see fit.
EDIT: i cannot seem to upload a sample spreadsheet. I am trying to fix this and get one up asap.Please Login or Register to view this content.
Bookmarks