Userform

P

Paul Tikken

Hi,

I've got a userform in wich i've got a several listboxes of values you can
choose from, these values are coming from several lists (lets say; A1:A100
for listbox 1 C1:C100 for listbox 2) in a worksheet(SHEET1). What i would
like is that when I choose a value in listbox 1 that this value is not longer
available is this listbox, turns grey or something like that, so that it
cannot be choosen a second time.

For listbox 2 I would like the following, the contents of this listbox are
being used to fill out columns F and G. Listbox 2 contains a number sequence
(0, 77, 100, 177, 200, 277, 300, 377, 400, 477, 500 etc, so only octals). So
if number 77 is used to fill out column F and number 300 is used to fill out
column G, I would like to see not only these two numbers turn grey, but also
the numbers in between.

Any ideas?

Paul
 
N

Nigel

You cannot selectively change the color of items in a ListBox. You can
remove items by reference to there index number.
 
P

Paul Tikken

Nigel,

Thanks for your reply. How can I make, that removing items by reference to
their index number, happen?

Cheers,

Paul
 
N

Nigel

Private Sub ComboBox1_Change()
With ComboBox1
If .ListIndex >= 0 Then
.RemoveItem .ListIndex
.ListIndex = -1
End If
End With
End Sub

The above only works if the control is not bound, in other words the list is
loaded into the control. Not by using the Control Source property
--

Regards,
Nigel
(e-mail address removed)
 
P

Paul Tikken

Thanks Nigel works like a charm!

Sorry for the late response, been away for a while!!

cheers,

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top