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

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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