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
    With txtdateac
        txtdateac.Text = Format(Now(), "DD/MMM/YYYY/HH/NN/AM/PM")
        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

Participate now!

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