With a macro it's quite simple
Do you know how to write a macro?
You use the same range and check for the size value and the just add the number in the offset (0,-1) as count.