Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I've just experienced an anoying item for which I can't seem to find a solution other then completely reprogramming a certain routine. In listboxes with multiple items selected, when you change the front or back color all items selected are de-selected. I can't find any comments in the VBA books I have or Excel help. I also tried finding something similar on this forum but to no avail. Is there a solution for this anoying effect? Is there anybody whom might be able to shed some light on this? Thanks in advance for any ideas. Leon -- droopy928gt ------------------------------------------------------------------------ droopy928gt's Profile: http://www.excelforum.com/member.php...o&userid=30232 View this thread: http://www.excelforum.com/showthread...hreadid=528965 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've never noticed this, but I don't think I've ever changed the font <bg.
Maybe you could just keep track of what was selected before you do your stuff. I build a userform with a listbox and a couple of buttons. This seemed to work ok. Option Explicit Private Sub CommandButton1_Click() Dim mySelected() As Boolean Dim iCtr As Long Dim TopItem As Long With Me.ListBox1 TopItem = .TopIndex ReDim mySelected(0 To .ListCount - 1) For iCtr = 0 To .ListCount - 1 mySelected(iCtr) = .Selected(iCtr) Next iCtr If .Font.Name = "Arial" Then .Font.Name = "Courier New" Else .Font.Name = "Arial" End If For iCtr = 0 To .ListCount - 1 .Selected(iCtr) = mySelected(iCtr) Next iCtr .TopIndex = TopItem End With End Sub Private Sub CommandButton2_Click() Unload Me End Sub Private Sub UserForm_Initialize() Dim iCtr As Long With Me.ListBox1 .MultiSelect = fmMultiSelectMulti For iCtr = 1 To 10 .AddItem "asdf" & iCtr Next iCtr End With End Sub droopy928gt wrote: I've just experienced an anoying item for which I can't seem to find a solution other then completely reprogramming a certain routine. In listboxes with multiple items selected, when you change the front or back color all items selected are de-selected. I can't find any comments in the VBA books I have or Excel help. I also tried finding something similar on this forum but to no avail. Is there a solution for this anoying effect? Is there anybody whom might be able to shed some light on this? Thanks in advance for any ideas. Leon -- droopy928gt ------------------------------------------------------------------------ droopy928gt's Profile: http://www.excelforum.com/member.php...o&userid=30232 View this thread: http://www.excelforum.com/showthread...hreadid=528965 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Dave, Thanks for the reply. What you suggest is indeed what I meant with reprogramming a certain routine. I'd never noticed it either but due to a window being used for multiple purposes I thought to be smart and change the back ground color for the item selected so the user would immediatly see where he was in that window. Normally this is no issue at all but with listboxes where items are selected the selected items are lost and need to be reselected which is annoying ofcourse. Best regards, Leon v/d Willik -- droopy928gt ------------------------------------------------------------------------ droopy928gt's Profile: http://www.excelforum.com/member.php...o&userid=30232 View this thread: http://www.excelforum.com/showthread...hreadid=528965 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not quite sure what you're doing (and I didn't test this, either)...
But maybe you could have two listboxes--one visible and one hidden. Then hide/show the ones you want. droopy928gt wrote: Hi Dave, Thanks for the reply. What you suggest is indeed what I meant with reprogramming a certain routine. I'd never noticed it either but due to a window being used for multiple purposes I thought to be smart and change the back ground color for the item selected so the user would immediatly see where he was in that window. Normally this is no issue at all but with listboxes where items are selected the selected items are lost and need to be reselected which is annoying ofcourse. Best regards, Leon v/d Willik -- droopy928gt ------------------------------------------------------------------------ droopy928gt's Profile: http://www.excelforum.com/member.php...o&userid=30232 View this thread: http://www.excelforum.com/showthread...hreadid=528965 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
changing colors | Excel Discussion (Misc queries) | |||
Changing colors? | Excel Discussion (Misc queries) | |||
Changing the colors | Excel Discussion (Misc queries) | |||
Changing colors | Charts and Charting in Excel | |||
Changing colors | Excel Programming |