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

Important Notice


Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.

  • 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!