![]() |
Userform
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 |
Userform
Nigel,
Thanks for your reply. How can I make, that removing items by reference to their index number, happen? Cheers, Paul "Nigel" wrote: You cannot selectively change the color of items in a ListBox. You can remove items by reference to there index number. -- Regards, Nigel "Paul Tikken" wrote in message ... 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 |
Userform
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 "Paul Tikken" wrote in message ... Nigel, Thanks for your reply. How can I make, that removing items by reference to their index number, happen? Cheers, Paul "Nigel" wrote: You cannot selectively change the color of items in a ListBox. You can remove items by reference to there index number. -- Regards, Nigel "Paul Tikken" wrote in message ... 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 |
Userform
Thanks Nigel works like a charm!
Sorry for the late response, been away for a while!! cheers, Paul "Nigel" wrote: 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 "Paul Tikken" wrote in message ... Nigel, Thanks for your reply. How can I make, that removing items by reference to their index number, happen? Cheers, Paul "Nigel" wrote: You cannot selectively change the color of items in a ListBox. You can remove items by reference to there index number. -- Regards, Nigel "Paul Tikken" wrote in message ... 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 |
All times are GMT +1. The time now is 02:34 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com