Use ListBox properties in This Workbook

  • Thread starter Thread starter cristio26
  • Start date Start date
C

cristio26

Thanks alot Tom!!!

Finally I discovered that it also works if you specify in which shee
the listbox is.

(ex:Sheet1). It doesn't work if you put the sheet name.

Thanks 1000 times!

Regards, Cristi
 
It depends on what you mean by Sheetname and what you mean by Sheet1. You
didn't say anywhere where the listbox is located, so I made a guess.

You can refer to a listbox using the code name

Sheet1.Listbox1.Value

or using the sheetname

Worksheets("Data").Listbox1.Value

for example, from the immediate window:

? sheet1.Name
Data
? worksheets("Data").CodeName
Sheet1
? sheet1.ListBox1.Value
Item10
? worksheets("Data").Listbox1.Value
Item10

What is acceptable can also be affected by where the code is located.
 

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

Back
Top