userforms and comboboxes

ramasterre

Active Member
Joined
Oct 5, 2004
Messages
253
I've been looking all over the site and I just cant find the answer...

I'm sure this is a simple question. In VBA editor I am creating a user form which has a combobox. I want the combobox's list to populate based on values in a particular column on a non-active sheet. How can I write this out for vba?

Thanks!
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,351
Office Version
  1. 365
Platform
  1. Windows
Whoops!:oops:

My typo.

That's what you get for not testing things.

Should be something like this.
Code:
TextBox1.Text = Worksheets("Sheet2").Range("B" & ComboBox1.ListIndex + 1)).Value

This code isn't tested and is really just to illustrate the principle.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,171,650
Messages
5,876,670
Members
433,205
Latest member
jabin1991

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