• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

not able to add date & time to textbox in userform

narsing rao

Member
Hi Forum,
i am trying to add date & time to textbox, i have created a userform with combo box and text box in one of the textbox i am trying to display date & time but its not happening.

Code:
datebox.Value = Format(Now(), "mm/dd/yyyy hh:mm:ss")

and also tried
Code:
Private Sub UserForm_Initialize()
datebox.Value = Format(Now(), "mm/dd/yyyy hh:mm:ss")
end sub

but non of them are working.
 
Last edited:
try

(works for me)
Code:
PrivateSub UserForm_Initialize()
datebox1.Value = Format(Now, "mm/dd/yyyy hh:mm:ss")
end sub
 
Back
Top