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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
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,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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