ListBox Using VBA

mpopkowski

Board Regular
Joined
Jul 30, 2003
Messages
67
I'm trying to add to a userform, a simple window, that allows you to scroll down and enter the state you are from. I've gone through the archived articles on this site but have not been successful yet.
I appreciate everybodys patients and don't know where I would be without this site !! :oops:
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
I looked at the first example but I must be missing something. There seems to be only one line of code. Where is the January - December read from and I don't have a scroll bar. Please elaborate :oops:
 
Upvote 0
I have created a userform and added a listbox to it. Since, I've never done a listbox in VBA before, when will I see the scroll bar and where does the data go to allowing the user to scroll through and select ?? I know this probably very easy but I'm claiming stupidity !!! :oops:
 
Upvote 0
Aloha...

I understand your confusion! Helpful examples if you can figure out how to get around.

If you go to VBE and open the first userform with a list box (the one with the months), click the userform (not the list box) and click Run, you should get a running version of the list box form, scrollbars and everything.

If you have the userform open in VBE, select one of the list boxes, and look in the Properties window, you should see a property way down that says RowSource. It shows that the months come from a workbook sheet called listsheet, and the cells used for the list are a1:a12.

So if you leave VBE and go into the worksheets one is called TableOfContents, the other is ListSheet.

Click on the ListSheet tab, and you'll see the lists the author uses to add items to his/her forms.

Does that help?

(Thanks for the link, PaddyD!)

Tana-Lee
 
Upvote 0
Aloha Part II....

You're welcome.

I was in a hurry the other day, so I didn't take time to mention the other list box example from the link above.

Did you see it? It's the second one in the table of contents in the userform training download.

It demonstrates several ways of loading data into list boxes.

Let me know if you saw it or need more direction to it.

Tana-Lee
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,861
Members
449,052
Latest member
Fuddy_Duddy

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