Hi, need little help here. Im struggling with this VBA code. Not be able to format date in “dd/mm/yyyy” while uploading VBA userform.
And time and date displays as Decimal.
What’s wrong with this code.
>>> use code - tags <<<
And time and date displays as Decimal.
What’s wrong with this code.
>>> use code - tags <<<
Code:
ScTime & ScDuration defined as DATE
Thanks
Private Sub ScDate_AfterUpdate()
ScDate = Format(ScDate, "dd/mm/yyyy")
End Sub
Private Sub ScDuration_Change()
ScDuration = Format(ScDuration, "h:mm")
End Sub
Private Sub ScDuration_AfterUpdate()
ScDuration = Format(ScDuration, "h:mm")
End Sub
Private Sub ScTime_AfterUpdate()
ScTime = Format(ScTime, "hh:mm AM/PM")
End Sub
Private Sub ScTime_Change()
ScTime = Format(ScTime, "hh:mm")
End Sub
Private Sub UserForm_Activate()
ScStatus.RowSource = "=Statuses"
ScDuration.RowSource = "=Duration"
Me.Category.RowSource = "Category"
ScTime.RowSource = "=Times"
Priority.RowSource = "=Priority"
ScTime = Format(ScTime.Text, "hh:mmAM/PM")
ScDuration = Format(Me.ScDuration.Text, "h:mm")
End Sub
Last edited by a moderator: