Textbox doesn't populate sheet with new value (AfterUpdate)

  • Hello everyone,


    I have a textbox (REF1) on an userform for entering product codes, which are always 6 digits, and some have leading zeros, so I got a code off the internet (my "addLeadingZeros" function) to add the right number of leading zeros.
    Ex: 12 becomes 000012


    I called it from an AfterUpdate Sub so that the correct reference number could appear right after exiting the textbox.


    This works just fine, but when I want to populate the worksheet with that textbox value, it populates exactly what the user has entered and not the correct reference...


    Here's my code:


    I am quite stuck here, any help would be much appreciated! Thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!