In case you're not necessarily looking for a VBA solution, you can use
the REPT function in excel to mimic the code that Ben posted without
having to use VBA.
Just enter the formula
=REPT(" ",5) and you'll get 5 spaces
If you use something like ="t"&rept(" ",C2)&"R" when C2 has an integer
(like 7) in it, you'll return "t R" just as Ben would with the
Space function.