Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Removing a value question

Current Code:

Private sub CommandButton5_Click()
If Me.ListBox2.Value < "" Then
Me.ListBox2.RemoveItem Me.ListBox2.Value
End If
End Sub

I keep getting an error of Invalid Argument and it debugs to line 3 of this
code sniplet. Please let me know if there is another way I can do this. It
needs to take the selected value from ListBox2 when the button is clicked.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Removing a value question

Try:
Me.ListBox2.RemoveItem Me.ListBox2.ListIndex
--
Charles Chickering

"A good example is twice the value of good advice."


"trward79" wrote:

Current Code:

Private sub CommandButton5_Click()
If Me.ListBox2.Value < "" Then
Me.ListBox2.RemoveItem Me.ListBox2.Value
End If
End Sub

I keep getting an error of Invalid Argument and it debugs to line 3 of this
code sniplet. Please let me know if there is another way I can do this. It
needs to take the selected value from ListBox2 when the button is clicked.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Removing a value question

Thanks Charles. This fixed it right up. It removed the value.

"Charles Chickering" wrote:

Try:
Me.ListBox2.RemoveItem Me.ListBox2.ListIndex
--
Charles Chickering

"A good example is twice the value of good advice."


"trward79" wrote:

Current Code:

Private sub CommandButton5_Click()
If Me.ListBox2.Value < "" Then
Me.ListBox2.RemoveItem Me.ListBox2.Value
End If
End Sub

I keep getting an error of Invalid Argument and it debugs to line 3 of this
code sniplet. Please let me know if there is another way I can do this. It
needs to take the selected value from ListBox2 when the button is clicked.

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
Help removing "space" character (question updated) smartgal Excel Discussion (Misc queries) 5 June 30th 08 08:21 PM
Removing items from worksheet by account number question LiveUser New Users to Excel 3 November 10th 07 01:31 PM
Vlookup question -- removing bad numbers kwstroud Excel Discussion (Misc queries) 2 May 25th 07 08:52 PM
question about removing text from cells, leaving numbers JPN5804 Excel Discussion (Misc queries) 3 November 28th 05 05:55 PM
Question about removing Web formats and content 43N79W Excel Programming 2 August 23rd 04 06:20 PM


All times are GMT +1. The time now is 03:22 PM.

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"