LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default check if values is already in listbox

hello,

i'm working with excel 2000 and i have the next code in my program:

Private Sub cmb1_Click()
myRow = ActiveCell.Row
Dim Bcell As Range
Form1.ListBox1.Clear
For Each Bcell In Range(("A" & myRow) & (":J" & myRow))
If Bcell.Value = "C" Or Bcell.Value = "S" Or Bcell.Value = "I" Then
Form1.ListBox1.AddItem
ThisWorkbook.Sheets("Sheet1").Range(((ConvertToLet ter(Bcell.Column)) & "1"))
End If
Next Bcell
end sub

so basicly it does the following when myrow = 4
it searches for the values C, S or I in the range A4:J4. When one of these
letters is found the value of row 1 in that same column is added into the
listbox. But now i want a check that makes sure that if the value of row 1 is
already in the listbox, it is not added again. I know the code has to come
after If Bcell.Value = "C" Or ... and that it has to loop through the
listbox, but i have no idea what the code has to be. Can any help me with it?


 
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
Loop through column(s) to check values, perform action based on check ward376 Excel Programming 4 November 6th 07 03:21 PM
Multiselect listbox with check boxes Kandi Excel Programming 0 March 31st 05 09:53 PM
Fill values into a listbox matching selected values from a combobox Jon[_19_] Excel Programming 4 January 25th 05 04:25 PM
Compare Listbox values with Collection values Stuart[_5_] Excel Programming 2 September 20th 03 01:58 PM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


All times are GMT +1. The time now is 10:19 AM.

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"