ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to refer to a listbox (https://www.excelbanter.com/excel-programming/312964-how-refer-listbox.html)

Geof Wyght[_2_]

How to refer to a listbox
 
Hello,
I have a listbox on a worksheet. I know how to refer to it
from the worksheet module that it's in:
Me.listTasks.ListIndex = -1
but how would I refer to it from another module?
Thanks.
Geof.

Tom Ogilvy

How to refer to a listbox
 
? worksheets("Sheet1").Listbox1.Value
DDDD

as an example.

--
Regards,
Tom Oglvy

"Geof Wyght" wrote in message
...
Hello,
I have a listbox on a worksheet. I know how to refer to it
from the worksheet module that it's in:
Me.listTasks.ListIndex = -1
but how would I refer to it from another module?
Thanks.
Geof.




Geof Wyght[_2_]

How to refer to a listbox
 
Yes, that helped, thanks.
For some reason, this did not work:
wksDash.listTasks.ListIndex = -1
whe
Set wksDash = ThisWorkbook.Worksheets("Dashboard")

But this did:
ThisWorkbook.Worksheets("Dashboard").listTasks.Lis tIndex
= -1

Geof.
-----Original Message-----
? worksheets("Sheet1").Listbox1.Value
DDDD

as an example.

--
Regards,
Tom Oglvy

"Geof Wyght" wrote

in message
...
Hello,
I have a listbox on a worksheet. I know how to refer to

it
from the worksheet module that it's in:
Me.listTasks.ListIndex = -1
but how would I refer to it from another module?
Thanks.
Geof.



.



All times are GMT +1. The time now is 09:38 PM.

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