How to call a worksheet within VBA

nikdwg7

New Member
Joined
Jan 21, 2010
Messages
3
hi... i created a form in VB 6.5 which has a list box. i want to populate this listbox with a 2 column table created in another worksheet (Sheet1) but same workbook so I can sort the data easily. currently, the data is inputted manually within the code ex:

Private Sub UserForm_Initialize()
Dim Resource_Name As Variant


Resource_Name = VBA.Array("25C092", "33B002", "33B003", "33B004", "33B005", "33B005B01", "33B006", "33B006F01", "33B006F02", "33B006G01", "33B006G02", "33B006G03", "33B007", "33B007A02", "33B009",.......)

This makes it hard to find specific a specific number. I want to be able to show both the number and associated name, sort the data numerically or alphabetically and add rows when needed within Sheet1.
Current VBA.Array only shows numbers, not associated name.
I tried to Set RowSource on form to Sheet1 and the range. Listbox was populated just as I wanted, but query would not work. Currently when user chooses a number from listbox on form, it queries from an sql db.

Any help is much appreciated. Thanks!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,213,482
Messages
6,113,916
Members
448,533
Latest member
thietbibeboiwasaco

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