Rowsource referenced to a hidden workbook

B

borg

Hi,

I would like a rowsource of a textbox in a userform to be reference to an
open but hidden workbook.

I've tried this but it doesn't work:

sub test
with userform1
.listbox1.rowsource=workbooks("book2.xls").worksheets(1).range("A1:A100")
.show
end with
end sub

Thanks a lot!
 
D

dok112

Update your rowsource to the below.

..listbox1.rowsource = "Sheet2!A1:A100"

You need to tell it the sheet name in the book. If this is a different
workbook that you are referencing then the one your form is in, then you
have to word it a little differently.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top