|You have taken what was a fairly simple request and made it considerably more complex.|
VBA has not evolved to a point where it can read minds. As orginally requested, and therefore as written, when you enter a number in a cell, the code inserts one less row than the number entered. Now let's say you come along later and change that number. How is the code supposed to know if you want to insert more rows or delete some rows?
You'll have to tell me if there is something that the code can "test" to determine what action to take. For example, let's say you enter a 3 in D10 and the code inserts 2 blank rows below it. D11:D12 will be empty. If you immediately enter a 2 (meaning you want 1 less row than previously added) the code can check for the empty cells, delete them and then add a single row.
However, if you enter a 3 in D10 and thne enter something in D11 and then change D10 from a 3 to a 2, how will code know what you want to do? It can't test for empty cells so it will have no way of knowing whether you want to add or delete rows.
We need to know more about you are trying to do - in it's entirety - before we can offer any more suggestions. If you add requirements in small pieces, it is very hard to write code because it's not just a matter of adding more instructions. Sometimes it means a rewrite of everything. That gets fustrating, so it's better if you tell us everything you need done upfront.
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.