#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default list box

I would like the code to insert a name into a list box if
the check box is checked and remove it if it is
deselected. How could I do this.

thanks in advance.

Joe

Private Sub CheckBox1_Click()


If count Mod 2 = 0 Then
List.AddItem "Manning, Joe"
Else
List.RemoveItem (List.ListCount)
End If
count = count + 1


End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default list box

Try using the Checkbox1_AfterUpdate() event with the
following logic:

Private Sub cbxEnablePipette2_AfterUpdate()
If Checkbox1.value = true then
'add the item
Else
'remove the item
End If
End Sub

Hope that helps...

-----Original Message-----
I would like the code to insert a name into a list box if
the check box is checked and remove it if it is
deselected. How could I do this.

thanks in advance.

Joe

Private Sub CheckBox1_Click()


If count Mod 2 = 0 Then
List.AddItem "Manning, Joe"
Else
List.RemoveItem (List.ListCount)
End If
count = count + 1


End Sub
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default list box

Hi Joe,

Not sure if this is what you want, but try this... not
tested...
------------------------------
Private Sub CheckBox1_Click()

If CheckBox1 = True Then
ListBox1.AddItem "Manning, Joe"
Else
ListBox1.RemoveItem "Manning, Joe"
End If

End Sub
--------------------------------
Hope this helps...

Chong Moua

-----Original Message-----
I would like the code to insert a name into a list box if
the check box is checked and remove it if it is
deselected. How could I do this.

thanks in advance.

Joe

Private Sub CheckBox1_Click()


If count Mod 2 = 0 Then
List.AddItem "Manning, Joe"
Else
List.RemoveItem (List.ListCount)
End If
count = count + 1


End Sub
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default list box

I get an error when i try to use
listbox1.removeitem "manning, joe"

any other suggestions?

Thanks

Joe
-----Original Message-----
Hi Joe,

Not sure if this is what you want, but try this... not
tested...
------------------------------
Private Sub CheckBox1_Click()

If CheckBox1 = True Then
ListBox1.AddItem "Manning, Joe"
Else
ListBox1.RemoveItem "Manning, Joe"
End If

End Sub
--------------------------------
Hope this helps...

Chong Moua

-----Original Message-----
I would like the code to insert a name into a list box

if
the check box is checked and remove it if it is
deselected. How could I do this.

thanks in advance.

Joe

Private Sub CheckBox1_Click()


If count Mod 2 = 0 Then
List.AddItem "Manning, Joe"
Else
List.RemoveItem (List.ListCount)
End If
count = count + 1


End Sub
.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default list box

Joe, this should work...
----------------------
Private Sub CheckBox1_Click()

If CheckBox1 = True Then
ListBox1.AddItem "Manning, Joe", 1
Else
ListBox1.RemoveItem 1
End If

End Sub
----------------------
Chong Moua

-----Original Message-----
I get an error when i try to use
listbox1.removeitem "manning, joe"

any other suggestions?

Thanks

Joe
-----Original Message-----
Hi Joe,

Not sure if this is what you want, but try this... not
tested...
------------------------------
Private Sub CheckBox1_Click()

If CheckBox1 = True Then
ListBox1.AddItem "Manning, Joe"
Else
ListBox1.RemoveItem "Manning, Joe"
End If

End Sub
--------------------------------
Hope this helps...

Chong Moua

-----Original Message-----
I would like the code to insert a name into a list box

if
the check box is checked and remove it if it is
deselected. How could I do this.

thanks in advance.

Joe

Private Sub CheckBox1_Click()


If count Mod 2 = 0 Then
List.AddItem "Manning, Joe"
Else
List.RemoveItem (List.ListCount)
End If
count = count + 1


End Sub
.

.

.

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
Comparing List A to List B and add what's missing from List B Gilbert Excel Discussion (Misc queries) 2 July 20th 09 11:18 PM
create new list from list A, but with exclusions from a list B Harold Good Excel Worksheet Functions 3 April 11th 08 11:23 PM
validation list--list depends on the selection of first list Michael New Users to Excel 2 April 27th 06 10:23 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM
find names on list 1 in list 2. list 1 4000 names list 2 400 name Ed Excel Worksheet Functions 1 September 4th 05 12:48 AM


All times are GMT +1. The time now is 09:17 AM.

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

About Us

"It's about Microsoft Excel"