Hello there,

I'm trying to format a string which consists of 20 numbers and one letter OR a 21 alphanumeric numbers only to a specific format with VBA on a form but unsure how to go about in doing it.
When I receive the data, it gives me a very long 21 characters string and I need to format it to something like,
either [if with letter] ## ### #X# ## #### #### ### [X represents the letter] or [if no letter] ## ### ### ## #### #### ###.

Is there any way I can format the string from either by looking at whether there is a letter or not. I know how to do it if it was just a string of 21 numbers but the existence of the letter doesn't make it easy.

Thank you very much.