Time error in user form

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
 
B

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top