Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Multi Select List Box - Checkbox

Ah ! I've tried using this format of code in the Initialisation code of a
form, but it keeps failing with a message 'Member of data member not found'

Is this a case of not having the code run in the right place ? If so, what
is the right place ?

"Joel" wrote:

Private Sub CheckBox1_Click()
ActiveSheet.ListBox1.MultiSelect = fmMultiSelectMulti
End Sub


"Paul" wrote:

I want to make my list box available for multi selection using checkboxes - I
know it must be easy, but I'm having a bad day and can't work it out.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Multi Select List Box - Checkbox

I think there are 3 different answers to your question because I'm not sure
where the code is located and which type form you are refereing to.

there are two different type forms, one is a worksheet and the other is the
VBA Userform. I suspect you are using the VBA form where you may need to
reference the form name as well as the listbox name.


1) You may not have the right sheet name or listbox name. The names of the
listbox can be renamed from the property window or through code. If you are
in a worksheet you need to get into Design Mode and right click the Listbox
to changge names or check the name.

enter Design Mode by the following
a) worksheet menu View - toolbars - Control Toolbox. click on the
Triangle to enter or exit design Mode

2) Check the properties of a VBA form. From VBA menu View - Properties
Window. Check name property. by the way you can manually vchange the List
box Multiselect property from the property window on wither the worksheet of
the VBA form property.


3) I think your problem if you are using worksheet VBA code, then you need
to use
Userform1.Listbox1.MultiSelect = fmMultiSelect


You can put initialization code for a listbox in the initilization code for
the userform

Private Sub UserForm_Initialize()
UserForm1.lstNames.AddItem "Test One"
UserForm1.lstNames.AddItem "Test Two"
UserForm1.txtUserName.Text = "Default Name"
End Sub

when the code say private it means it has to be inside the userform. If you
right click the userform in VBA and select view code is where you want to put
this code. A private function in a userform will recognize Listbox1 without
needing the Userform1 because the Listbox is part of the Userform. if you
are using two userforms then if you are referencing the 2nd Userfrom list box
from the first you need to include the Userform Name. The Userfrom Names are
not private because they need to be recognized from the worksheet put the
control objects in the form are usually private.



"Paul" wrote:

Ah ! I've tried using this format of code in the Initialisation code of a
form, but it keeps failing with a message 'Member of data member not found'

Is this a case of not having the code run in the right place ? If so, what
is the right place ?

"Joel" wrote:

Private Sub CheckBox1_Click()
ActiveSheet.ListBox1.MultiSelect = fmMultiSelectMulti
End Sub


"Paul" wrote:

I want to make my list box available for multi selection using checkboxes - I
know it must be easy, but I'm having a bad day and can't work it out.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Multi Select List Box - Checkbox

Joel, Many thanks for your speedy response.

I am using a VBA form, and I've added the form name to the coded, but still
without any success.

It is beginning to dawn on me that the issue is that, having specified
ListStyle as Option, I expected to see a property 'Multi' in the properties
window, but none is shown.

Just to be clear, I'm using Excel 2003.

"Joel" wrote:

I think there are 3 different answers to your question because I'm not sure
where the code is located and which type form you are refereing to.

there are two different type forms, one is a worksheet and the other is the
VBA Userform. I suspect you are using the VBA form where you may need to
reference the form name as well as the listbox name.


1) You may not have the right sheet name or listbox name. The names of the
listbox can be renamed from the property window or through code. If you are
in a worksheet you need to get into Design Mode and right click the Listbox
to changge names or check the name.

enter Design Mode by the following
a) worksheet menu View - toolbars - Control Toolbox. click on the
Triangle to enter or exit design Mode

2) Check the properties of a VBA form. From VBA menu View - Properties
Window. Check name property. by the way you can manually vchange the List
box Multiselect property from the property window on wither the worksheet of
the VBA form property.


3) I think your problem if you are using worksheet VBA code, then you need
to use
Userform1.Listbox1.MultiSelect = fmMultiSelect


You can put initialization code for a listbox in the initilization code for
the userform

Private Sub UserForm_Initialize()
UserForm1.lstNames.AddItem "Test One"
UserForm1.lstNames.AddItem "Test Two"
UserForm1.txtUserName.Text = "Default Name"
End Sub

when the code say private it means it has to be inside the userform. If you
right click the userform in VBA and select view code is where you want to put
this code. A private function in a userform will recognize Listbox1 without
needing the Userform1 because the Listbox is part of the Userform. if you
are using two userforms then if you are referencing the 2nd Userfrom list box
from the first you need to include the Userform Name. The Userfrom Names are
not private because they need to be recognized from the worksheet put the
control objects in the form are usually private.



"Paul" wrote:

Ah ! I've tried using this format of code in the Initialisation code of a
form, but it keeps failing with a message 'Member of data member not found'

Is this a case of not having the code run in the right place ? If so, what
is the right place ?

"Joel" wrote:

Private Sub CheckBox1_Click()
ActiveSheet.ListBox1.MultiSelect = fmMultiSelectMulti
End Sub


"Paul" wrote:

I want to make my list box available for multi selection using checkboxes - I
know it must be easy, but I'm having a bad day and can't work it out.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Multi Select List Box - Checkbox

I think you are looking at the Userform property and not the Listbox
Property.
after opening up the userform click on the Listbox to see its properties. I
can see the multiselect property on a listbox using both multiselect
properties.

It should be when you type the name of the Userform in the VBA code and then
the period the listbox name that you created should be in the list that
appears in the pop up box. Then when you type the listbox name and the
period the multiselect option will appear.

"Paul" wrote:

Joel, Many thanks for your speedy response.

I am using a VBA form, and I've added the form name to the coded, but still
without any success.

It is beginning to dawn on me that the issue is that, having specified
ListStyle as Option, I expected to see a property 'Multi' in the properties
window, but none is shown.

Just to be clear, I'm using Excel 2003.

"Joel" wrote:

I think there are 3 different answers to your question because I'm not sure
where the code is located and which type form you are refereing to.

there are two different type forms, one is a worksheet and the other is the
VBA Userform. I suspect you are using the VBA form where you may need to
reference the form name as well as the listbox name.


1) You may not have the right sheet name or listbox name. The names of the
listbox can be renamed from the property window or through code. If you are
in a worksheet you need to get into Design Mode and right click the Listbox
to changge names or check the name.

enter Design Mode by the following
a) worksheet menu View - toolbars - Control Toolbox. click on the
Triangle to enter or exit design Mode

2) Check the properties of a VBA form. From VBA menu View - Properties
Window. Check name property. by the way you can manually vchange the List
box Multiselect property from the property window on wither the worksheet of
the VBA form property.


3) I think your problem if you are using worksheet VBA code, then you need
to use
Userform1.Listbox1.MultiSelect = fmMultiSelect


You can put initialization code for a listbox in the initilization code for
the userform

Private Sub UserForm_Initialize()
UserForm1.lstNames.AddItem "Test One"
UserForm1.lstNames.AddItem "Test Two"
UserForm1.txtUserName.Text = "Default Name"
End Sub

when the code say private it means it has to be inside the userform. If you
right click the userform in VBA and select view code is where you want to put
this code. A private function in a userform will recognize Listbox1 without
needing the Userform1 because the Listbox is part of the Userform. if you
are using two userforms then if you are referencing the 2nd Userfrom list box
from the first you need to include the Userform Name. The Userfrom Names are
not private because they need to be recognized from the worksheet put the
control objects in the form are usually private.



"Paul" wrote:

Ah ! I've tried using this format of code in the Initialisation code of a
form, but it keeps failing with a message 'Member of data member not found'

Is this a case of not having the code run in the right place ? If so, what
is the right place ?

"Joel" wrote:

Private Sub CheckBox1_Click()
ActiveSheet.ListBox1.MultiSelect = fmMultiSelectMulti
End Sub


"Paul" wrote:

I want to make my list box available for multi selection using checkboxes - I
know it must be easy, but I'm having a bad day and can't work it out.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Multi Select List Box - Checkbox

When I type the names, etc. as you suggest, no MultiSelect option is available.

Is it possible that this is a service pack or update issue ?

"Joel" wrote:

I think you are looking at the Userform property and not the Listbox
Property.
after opening up the userform click on the Listbox to see its properties. I
can see the multiselect property on a listbox using both multiselect
properties.

It should be when you type the name of the Userform in the VBA code and then
the period the listbox name that you created should be in the list that
appears in the pop up box. Then when you type the listbox name and the
period the multiselect option will appear.

"Paul" wrote:

Joel, Many thanks for your speedy response.

I am using a VBA form, and I've added the form name to the coded, but still
without any success.

It is beginning to dawn on me that the issue is that, having specified
ListStyle as Option, I expected to see a property 'Multi' in the properties
window, but none is shown.

Just to be clear, I'm using Excel 2003.

"Joel" wrote:

I think there are 3 different answers to your question because I'm not sure
where the code is located and which type form you are refereing to.

there are two different type forms, one is a worksheet and the other is the
VBA Userform. I suspect you are using the VBA form where you may need to
reference the form name as well as the listbox name.


1) You may not have the right sheet name or listbox name. The names of the
listbox can be renamed from the property window or through code. If you are
in a worksheet you need to get into Design Mode and right click the Listbox
to changge names or check the name.

enter Design Mode by the following
a) worksheet menu View - toolbars - Control Toolbox. click on the
Triangle to enter or exit design Mode

2) Check the properties of a VBA form. From VBA menu View - Properties
Window. Check name property. by the way you can manually vchange the List
box Multiselect property from the property window on wither the worksheet of
the VBA form property.


3) I think your problem if you are using worksheet VBA code, then you need
to use
Userform1.Listbox1.MultiSelect = fmMultiSelect


You can put initialization code for a listbox in the initilization code for
the userform

Private Sub UserForm_Initialize()
UserForm1.lstNames.AddItem "Test One"
UserForm1.lstNames.AddItem "Test Two"
UserForm1.txtUserName.Text = "Default Name"
End Sub

when the code say private it means it has to be inside the userform. If you
right click the userform in VBA and select view code is where you want to put
this code. A private function in a userform will recognize Listbox1 without
needing the Userform1 because the Listbox is part of the Userform. if you
are using two userforms then if you are referencing the 2nd Userfrom list box
from the first you need to include the Userform Name. The Userfrom Names are
not private because they need to be recognized from the worksheet put the
control objects in the form are usually private.



"Paul" wrote:

Ah ! I've tried using this format of code in the Initialisation code of a
form, but it keeps failing with a message 'Member of data member not found'

Is this a case of not having the code run in the right place ? If so, what
is the right place ?

"Joel" wrote:

Private Sub CheckBox1_Click()
ActiveSheet.ListBox1.MultiSelect = fmMultiSelectMulti
End Sub


"Paul" wrote:

I want to make my list box available for multi selection using checkboxes - I
know it must be easy, but I'm having a bad day and can't work it out.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Multi Select List Box - Checkbox

I'm not sure you really have a Listbox. Try to delete the Listbox and
re-add. Then change the Name of theListbox so it is the same name as the
original box. A real Listbox shold have the property. You could of call a
Textbox a Listbox and really get confused.

"Paul" wrote:

When I type the names, etc. as you suggest, no MultiSelect option is available.

Is it possible that this is a service pack or update issue ?

"Joel" wrote:

I think you are looking at the Userform property and not the Listbox
Property.
after opening up the userform click on the Listbox to see its properties. I
can see the multiselect property on a listbox using both multiselect
properties.

It should be when you type the name of the Userform in the VBA code and then
the period the listbox name that you created should be in the list that
appears in the pop up box. Then when you type the listbox name and the
period the multiselect option will appear.

"Paul" wrote:

Joel, Many thanks for your speedy response.

I am using a VBA form, and I've added the form name to the coded, but still
without any success.

It is beginning to dawn on me that the issue is that, having specified
ListStyle as Option, I expected to see a property 'Multi' in the properties
window, but none is shown.

Just to be clear, I'm using Excel 2003.

"Joel" wrote:

I think there are 3 different answers to your question because I'm not sure
where the code is located and which type form you are refereing to.

there are two different type forms, one is a worksheet and the other is the
VBA Userform. I suspect you are using the VBA form where you may need to
reference the form name as well as the listbox name.


1) You may not have the right sheet name or listbox name. The names of the
listbox can be renamed from the property window or through code. If you are
in a worksheet you need to get into Design Mode and right click the Listbox
to changge names or check the name.

enter Design Mode by the following
a) worksheet menu View - toolbars - Control Toolbox. click on the
Triangle to enter or exit design Mode

2) Check the properties of a VBA form. From VBA menu View - Properties
Window. Check name property. by the way you can manually vchange the List
box Multiselect property from the property window on wither the worksheet of
the VBA form property.


3) I think your problem if you are using worksheet VBA code, then you need
to use
Userform1.Listbox1.MultiSelect = fmMultiSelect


You can put initialization code for a listbox in the initilization code for
the userform

Private Sub UserForm_Initialize()
UserForm1.lstNames.AddItem "Test One"
UserForm1.lstNames.AddItem "Test Two"
UserForm1.txtUserName.Text = "Default Name"
End Sub

when the code say private it means it has to be inside the userform. If you
right click the userform in VBA and select view code is where you want to put
this code. A private function in a userform will recognize Listbox1 without
needing the Userform1 because the Listbox is part of the Userform. if you
are using two userforms then if you are referencing the 2nd Userfrom list box
from the first you need to include the Userform Name. The Userfrom Names are
not private because they need to be recognized from the worksheet put the
control objects in the form are usually private.



"Paul" wrote:

Ah ! I've tried using this format of code in the Initialisation code of a
form, but it keeps failing with a message 'Member of data member not found'

Is this a case of not having the code run in the right place ? If so, what
is the right place ?

"Joel" wrote:

Private Sub CheckBox1_Click()
ActiveSheet.ListBox1.MultiSelect = fmMultiSelectMulti
End Sub


"Paul" wrote:

I want to make my list box available for multi selection using checkboxes - I
know it must be easy, but I'm having a bad day and can't work it out.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Multi Select List Box - Checkbox


Sub splitSheet()

InitStr = UCase("Initializing server")
With Sheets("Sheet1")
RowCount = 1
FirstRow = RowCount

Do While .Range("A" & RowCount) < ""
StrPos = InStr(UCase(.Range("A" & RowCount)), InitStr)
If .Range("A" & (RowCount + 1)) = "" Or StrPos 0 Then

If StrPos 0 Then
LastRow = RowCount - 1
Else
LastRow = RowCount
End If

If LastRow < 0 Then
Set newsht = Worksheets.Add(after:=Sheets(Sheets.Count))
.Rows(FirstRow & ":" & LastRow).Copy _
Destination:=newsht.Rows(1)
End If
FirstRow = RowCount + 1
End If
RowCount = RowCount + 1
Loop
End With
End Sub

"Paul" wrote:

When I type the names, etc. as you suggest, no MultiSelect option is available.

Is it possible that this is a service pack or update issue ?

"Joel" wrote:

I think you are looking at the Userform property and not the Listbox
Property.
after opening up the userform click on the Listbox to see its properties. I
can see the multiselect property on a listbox using both multiselect
properties.

It should be when you type the name of the Userform in the VBA code and then
the period the listbox name that you created should be in the list that
appears in the pop up box. Then when you type the listbox name and the
period the multiselect option will appear.

"Paul" wrote:

Joel, Many thanks for your speedy response.

I am using a VBA form, and I've added the form name to the coded, but still
without any success.

It is beginning to dawn on me that the issue is that, having specified
ListStyle as Option, I expected to see a property 'Multi' in the properties
window, but none is shown.

Just to be clear, I'm using Excel 2003.

"Joel" wrote:

I think there are 3 different answers to your question because I'm not sure
where the code is located and which type form you are refereing to.

there are two different type forms, one is a worksheet and the other is the
VBA Userform. I suspect you are using the VBA form where you may need to
reference the form name as well as the listbox name.


1) You may not have the right sheet name or listbox name. The names of the
listbox can be renamed from the property window or through code. If you are
in a worksheet you need to get into Design Mode and right click the Listbox
to changge names or check the name.

enter Design Mode by the following
a) worksheet menu View - toolbars - Control Toolbox. click on the
Triangle to enter or exit design Mode

2) Check the properties of a VBA form. From VBA menu View - Properties
Window. Check name property. by the way you can manually vchange the List
box Multiselect property from the property window on wither the worksheet of
the VBA form property.


3) I think your problem if you are using worksheet VBA code, then you need
to use
Userform1.Listbox1.MultiSelect = fmMultiSelect


You can put initialization code for a listbox in the initilization code for
the userform

Private Sub UserForm_Initialize()
UserForm1.lstNames.AddItem "Test One"
UserForm1.lstNames.AddItem "Test Two"
UserForm1.txtUserName.Text = "Default Name"
End Sub

when the code say private it means it has to be inside the userform. If you
right click the userform in VBA and select view code is where you want to put
this code. A private function in a userform will recognize Listbox1 without
needing the Userform1 because the Listbox is part of the Userform. if you
are using two userforms then if you are referencing the 2nd Userfrom list box
from the first you need to include the Userform Name. The Userfrom Names are
not private because they need to be recognized from the worksheet put the
control objects in the form are usually private.



"Paul" wrote:

Ah ! I've tried using this format of code in the Initialisation code of a
form, but it keeps failing with a message 'Member of data member not found'

Is this a case of not having the code run in the right place ? If so, what
is the right place ?

"Joel" wrote:

Private Sub CheckBox1_Click()
ActiveSheet.ListBox1.MultiSelect = fmMultiSelectMulti
End Sub


"Paul" wrote:

I want to make my list box available for multi selection using checkboxes - I
know it must be easy, but I'm having a bad day and can't work it out.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-select from a dropdown list PaulaG Excel Discussion (Misc queries) 5 April 7th 10 06:52 PM
Multi-Select List Box [email protected] Excel Programming 4 October 25th 07 10:47 AM
Last list item selected in a Multi-Select list box? Brian Excel Programming 3 December 5th 05 09:12 PM
Extract values from a multi-select multi-column list-box Peter[_20_] Excel Programming 5 September 28th 03 04:04 PM
Multi Select List Box jacqui Excel Programming 0 July 22nd 03 12:12 PM


All times are GMT +1. The time now is 05:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"