Actually, change this line:

a = a & Right(Text1.Text,Len(Text1.Text)-x)

to the following:

a = Right(Text1.Text,Len(Text1.Text)-x)



Should work now.