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: 26
Default Stopping duplications been entered into a listbox

Hi

I'm hoping you can assist as i can't find any relevant information on my
problem. I have two listboxes on a userform. When a command button is
clicked, it combines listbox1 and listbox2 together and creates a period into
listbox3. Listbox1 & listbox2 information are created when the userform is
Initialised. listbox1 is a multi select and listbox2 is a single select.
Example below:

Private Sub UserForm_Initialize()

With Me.ListBox1
..AddItem "Jan-Mar"
..AddItem "Apr-Jun"
..AddItem "Jul-Sep"
..AddItem "Oct-Dec"
..AddItem "Quarterly Calendar Year"
end With

With Me.ListBox2
..AddItem "2000"
..AddItem "2001"
..AddItem "2002"
..AddItem "2003"
..AddItem "2004"
end With

end Sub

Private Sub CommandButton1_Click()

Dim slist As String
Dim tlist As String
Dim lIndex As Long

For lIndex = 0 To 22

If ListBox1.Selected(lIndex) Then
slist = slist & ", " & ListBox1.List(lIndex)
tlist = " " & ListBox2.Value
End If
Next

ListBox3.AddItem Mid(slist, 3) & tlist

end Sub

My query is how can i stop duplications from been entered into listbox3?
 
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
Combining duplications and data Bill Excel Discussion (Misc queries) 8 February 11th 10 11:15 PM
Deleting Duplications Ray_V Excel Discussion (Misc queries) 3 August 10th 06 09:45 PM
can i prevent duplications in cells Jackie Excel Worksheet Functions 6 April 22nd 06 07:52 PM
Checking for data duplications Nikki Excel Discussion (Misc queries) 1 March 2nd 06 04:07 PM
remove duplications Vass Excel Discussion (Misc queries) 1 July 28th 05 04:32 PM


All times are GMT +1. The time now is 05:41 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"