I have a textbox on a userform that needs to automatically format to #########-#####
I am using this to add the "-" after the 9th digit, however some of my users are pasting the data into the text box with a dash already in the number, creating a second dash.
How can I change this so it doesn't matter if the user enters a dash or not, it only shows the dash at the 10th position and if the user only enters 9 numbers to add five zeros at the end? Formatting should look like this:
if entered 123456789 should change to 123456789-00000
if entered 12345678912345 should change to 123456789-12345
if entered 123456789-12345 should stay 123456789-12345
Bookmarks