ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use ListBox properties in This Workbook (https://www.excelbanter.com/excel-programming/314163-use-listbox-properties-workbook.html)

cristio26[_2_]

Use ListBox properties in This Workbook
 

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

--
cristio2
-----------------------------------------------------------------------
cristio26's Profile: http://www.excelforum.com/member.php...fo&userid=1551
View this thread: http://www.excelforum.com/showthread.php?threadid=27082


Tom Ogilvy

Use ListBox properties in This Workbook
 
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.

--
Regards,
Tom Ogilvy


"cristio26" wrote in message
...

Thanks alot Tom!!!

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

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

Thanks 1000 times!

Regards, Cristi!


--
cristio26
------------------------------------------------------------------------
cristio26's Profile:

http://www.excelforum.com/member.php...o&userid=15510
View this thread: http://www.excelforum.com/showthread...hreadid=270823





All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com