Time error in user form

  • Thread starter Thread starter bern
  • Start date Start date
B

bern

Hi
I have a user form with text boxes, one that gives a value of the
active cell contents of a time in a diary worksheet. These cells are
custom formated has hh:mm

The user form text box code is:
Private Sub txttime_Change()
txttime.Value = Format(txttime.Value, "hh:mm")
End Sub

This works well, for all times except 12:00.
When you activate a cell at 12:00 the text box reads 00:05 yet in all
other times its ok?
Any ideas whats wrong I have tried various forms of formatting.
Bern
 
Hi
I have managed to work it out myself, so for anybody with simila
problem:

I formated the time cells to text and entered ie 12:00
and entered a change event in the user form text box:

Private Sub txttime_Change()
txttime.Value = Format(ActiveCell.Value, "hh:mm")
End Sub
now all the times read as they should.
cheers
Ber
 
Back
Top