Textbox with time format and controlsource from spinbutton

Intronaut

New Member
Joined
Oct 11, 2017
Messages
7
I have a userform with a textbox that is formatted as time. A spinbutton sets the textbox's value by combining the textbox's tag property with the spinbutton's value, and the textbox then works fine displaying different time values from a column of data in a worksheet via changes in the spinbutton. However once I add code to the spinbutton''s change event that sets the textbox's contolsource property, the textbox starts displaying the time as a decimal instead of a time. I have tried multiple syntax options for formatting the textbox as a time after the controlsource statement, but none seems able to affect it at all. (I need the spinbutton to set the textbox's controlsource property so that the textbox can also feed the worksheet, not just vice versa.) Hope that description makes sense. Has anyone else encountered this? I hope I'm not repeating a previous thread; I searched Google for several hours today before deciding to go ahead with making an account here and posting the question. Would definitely appreciate any insight from you gurus. Many thanks!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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