Userform Control

tianimo

New Member
Joined
Sep 29, 2006
Messages
9
Hi,

does anyone know if Excel VBA Userforms are supposed to contain a "countbox" of some description as a standard (or 'additional') control for Userforms?

I've looked through the Toobox menus, and can't seem to find anything. It's certainly not one of the standard Microsoft Forms 2.0 controls provided with Excel 2003.

Perhaps I'm going crazy, but I swear I've seen it on someone else's version of Excel. It looks a bit like a spinbutton and a textbox displaying a number combined, except it's just one object.

Thanks

tianimo
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

kevin.philips

Active Member
Joined
Jan 7, 2003
Messages
364
Hi,

I can't find it anything on my machine that represents a single control that you seek, it is however very simple to code:

On a form place:

1 scrollbar (Named ScrollBar1)
1 Label (Name Label1)

In the code window for the form place the following:

Code:
Private Sub ScrollBar1_Change()
Label1.Caption = ScrollBar1.Value
End Sub

HTH

Regards

Kevin
 

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
Good afternoon tianimo

From the VBE go to Insert > UserForm. On the blank userform draw a textbox and a spinner. Now hold down Ctrl, select them both and drag them onto the Toolbox. Every time you open Excel this additional tool will be available and will set them both up at once if dragged onto the UserForm. Of course you'll have to reference them seperately when coding but that's not that difficult.

HTH

DominicB
 

Forum statistics

Threads
1,136,699
Messages
5,677,273
Members
419,683
Latest member
MrVBAConfused

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
Top