I have a file in which a have 15 products. But I do not always need 15 products so based on the value in cell A1 hide the unused rows from 6-20 and 31-45 automatically without pressing a macro button.

So if the value is 5 in A1 I want to hide rows 10 till 20 and 36 till 45. Is this possible. I would really appreciate the help.