I've done it! Though not as efficiently as your code haha .. mines all facking manual work cos i couldn't be asked to sit and figure out any other way .. so i've literally written the lines like ..
LOL took me ages, i got 5th slot on it .. so its kinda just a 5th slot generator :L:L Tbh, I just couldn't be asked to do anymore haha
a is textbox1 ofc
Code:
richtextbox1.text = "code here" & " " & a & vbnewline & "code here" & vbnewline &
a is textbox1 ofc

So thats credit enough haha
@