Time from userform

RJPotts

Board Regular
Joined
Apr 11, 2007
Messages
143
Hi,

I'm creating a userform to enter some date into a sheet.

About half of the data the form asks for each time are times. When I tried it after setting out the form they enter (into text boxes) without problem, I'm entering in hh:mm format.

Then I started setting it up to transfer each page of information to a temp worksheet. On the text-boxes I did that with the ControlSource attribute. Is that correct?

If I then enter, say, 02:00 its transferred to the worksheet correctly but appears in the text-box on the form as 8.33333333333333E-02.

Does anyone know what I'm doing wrong & how to fix it?

Rgds & thanks in advance
Richard
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi
One way, writing the code onto form module
Delete ControlSouce first.
Code:
Private Sub UserForm_Initialize()
TextBox1.Value = Sheets("YourSheetNameHere").Range("YourRangeHere").Text
End Sub

This transfer what you actually see in the cell, not the value in the formula bar.
So if the cell width is not wide enough to show the data, it will also show ###### in the textbox.
 
Upvote 0

Forum statistics

Threads
1,215,359
Messages
6,124,488
Members
449,166
Latest member
hokjock

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top