Not all of the red is error, unless you're not filtering the way you want.
See if this does what you're after.
Because your sample columns A:W differ in length, lastRow is calculated different than originally.
The loop that populates "M" based on "J" I've only applied to newly added data.
Only columns A:W portion of rows are deleted, column "Y" cells are numbers to verify this.
There is a button to put the original sample values back on the sheet so you can easily play with it over and over.
If you uncomment the STOP instruction in the code and split your screen half code and half sheet,
you can step through the code a line at a time with the F8 key and watch what happens on the sheet with execution of each instruction.
I hope I've commented the code enough to follow without too much trouble.
|