Some observations:
- You have 4 subroutines in your program which are not used, (not critical but unnessesary)
- in Sub comienzo you loop from 2 to 9 which excludes number ending in a 1, so 121 cannot be factorised,
changing the loops from into 1 to 9 solves this. - you calculate in these loops b (64 or 81 times), this is always the same, put that before the loops.