So, I am finally looking at your attached workbooks and running through your code (up until now I haven't been testing the code I provide. I've just been drafting it in Notepad++ and then pasting it here.). I had forgotten that Match() cannot be used to find blank cells.
So, here is a replacement for the Match() function method above. I know I promised the next code I provided would be a solution to your problems, but I figured I would address my own errors seperately.
Ok, now while running your code on the provided sample workbooks, I have come upt with a couple of questions/comments.
Why are you testing for the U column formula(s) to evaluate to six? Meaning, why copy data? It seems to me this is just to create filler rows. Why is this necessary? Why not just delete all blank rows?
This code:
doesn't seem to do anything. You have just filled the first 190 rows with a formula. So this line of code does nothing but delete the rows from 191 to 500. xlCellTypeBlanks does not consider a cell blank if it has a formula in it, even if the formula evaluates to blank. Wait... I just reread your original post and realized this is one of your issues you describe. Nevermind. I will address this when I post my final code.
Lastly, is there a step you take between Cleaner1() and Cleaner2()? Meaning, I would like to merge the two together into a single procedure, and so get rid of the unecessary insertion of rows blank rows only to have them deleted a moment later. Also, combining them will enable me to run loops to identify the rows to adjust, insert or delete without hard-coding the range addresses. Does this agree with your goals?
Bookmarks