Userform-Transferred Data must not be editable

  • Can we actually make a textbox data from a userform not editable when it is transferred to a column? I have a textbox that collects current date and time when it's submitted. When submitting the form, user will not be able to write or select any date as it comes automatically. (Refer photo below).



    Code
    1. With txtdateac
    2. txtdateac.Text = Format(Now(), "DD/MMM/YYYY/HH/NN/AM/PM")
    3. End With


    However, user can change the date and time after it has been submitted. The only way I can think of is to lock the cells for editing.


    Are there any options besides locking the column? Thanks for your support!

  • Just to add on, here's the full code I designed for the form.

  • You would need to lock the cells and protect the sheet.


    The code would then need to unprotect the sheet before entering data, afterward restore the protection. Alternatively, use Protect with UserInterFace Only, read more and get an example file here