This has no business application, and appears to be a homework assignment. Please complete your own homework, as you will learn nothing if you don't do it yourself.
here is a hint. Build your for loop using the values in the cell. So your loop could be built as:
Thecount = cell ("b2").value
For theloop = 1 to thecount
Do your code here
That should give you a good head start.