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 =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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