text box displaying time?

S

scrabtree23

On a userform, I placed a text box that ties to a cell in
a worksheet that displays a time. However, the text box
converts the time to serial code. How do I make the text
box display the time as time?

SDC
 
T

tomhaddock

Hi

Use property Text instead of Value to call the value of the cell. For
example in the Initialise event I have:

Private Sub UserForm_Initialize()

TextBox1.Text = Cells(1, 1)*.Text*

End Sub

The Text property takes the data as formatted rather than its true
value.

Tom
 
T

Tom Ogilvy

the easiest approach in my opinion is to load the textbox with a string
rather than using a control source. Clear your control source and in the
userform initialize event

Textbox1.Text = Worksheets(1).Range("A1").Text
 

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