I have no data and no code so, just as a quick experiment, I made this routine to populate a range, store it in an array and print out the content.
So, from the debug output, you can see the lower bounds and upper bounds of the array. And you can determine the content of each element in the array.
I guess, in broad terms, that is what you are doing. Presumably, column B has a key field? And, maybe you delete the key field if you want to delete a row? And Redim Preserve the array to add new rows to the end. And you can amend the elements within the array.
Whatever, for what it's worth, the row number maps to the array index plus one (+1). So, you know where stuff is. Similarly, the column number.
If you consider that you have an input array that you work on ... however you do that ... when you're finished, you could loop through that input array and move the entries to an output array if the key field isn't blank. Then just clear the input RANGE and write the output ARRAY back to the worksheet.
If you track how many "rows" you delete and how many you add, you can calculate the dimensions of the output array AND the range that you will write to.
Anyway, my thoughts on the subject. Hope it helps. I see no reason why you need to operate on a row by row basis.
Regards, TMS
Bookmarks