drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 543
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and Thanks in Advance
I have 4 different Active X Controls, ListBoxes whithin my WorkBook with "multiselect=fmMultiSelectMulti"
I have to use 3 different macros doing many different jobs with this ListBoxes.
But the Jobs are the same for this 4 ListBoxes.
So I would like to use a generic macro.
is there a way to refer to this ListBoxes like:
If Sheets(Sheet2.Name).ListBoxes("ListBox1").Selected(1) = True Then MsgBox "Thanks 1"
I mean use generic names to be able to use just 3 macros and not (4*3=12) macros
I have 4 different Active X Controls, ListBoxes whithin my WorkBook with "multiselect=fmMultiSelectMulti"
I have to use 3 different macros doing many different jobs with this ListBoxes.
But the Jobs are the same for this 4 ListBoxes.
So I would like to use a generic macro.
Code:
If Sheet2.ListBox1.Selected(1) = True Then MsgBox "Thanks 1"
If Sheet3.ListBox2.Selected(1) = True Then MsgBox "Thanks 2"
If Sheet45.ListBox3.Selected(1) = True Then MsgBox "Thanks 3"
is there a way to refer to this ListBoxes like:
If Sheets(Sheet2.Name).ListBoxes("ListBox1").Selected(1) = True Then MsgBox "Thanks 1"
I mean use generic names to be able to use just 3 macros and not (4*3=12) macros