Format Date VARIABLE to short date VBA -
i have user inputted via userform.textbox.value. general date want switch short date. (or try time drop reads 00:00). tried code
sdate=format(date,(d))
but returns current date rather variable date without time. want drop time if there easier way accepting of idea.
please, see: format function.
usage:
'userform has textbox named txtdate dim mydate date, sdate string mydate = me.txtdate 'dateserial(2014,12,11) sdate = format(mydate, "short date") 'or sdate = format(mydate, "yyyy/mm/dd")
Comments
Post a Comment