Hiding and displaying Listboxes through VBA

gjp55

New Member
Joined
Mar 31, 2011
Messages
34
Hi , I have a worksheet that has multiple different listboxes of which at any point will have 3 displayed and the rest hidden (to stop the worksheet looking cramped). This works fine and to display other list boxes, will hide all listboxes and then only display the ones allocated to that button. What I do have though is when I click the button, the listboxes that I want displayed flash for a second in another part of the screen then correctly display in the right position. The listboxes are displayed in the same positions (for example, sales section has 3 listboxes which are displayed when the sales button is selected and have vba to position them in the right positions and the Time section displays 3 listboxes in the same positions as the sales listboxes when selected hiding the Sales listboxes).

Is there a way to stop the listboxes flashing up before they are displayed in the correct position ? - or is this something that just happens when using this sort of functionality ?

Thanks
GJP
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

doofusboy

Well-known Member
Joined
Oct 14, 2003
Messages
1,325
To avoid the 'flashing' you could try putting Application.ScreenUpdating = False before your listbox code and then Application.ScreenUpdating = True after your listbox code.
 

gjp55

New Member
Joined
Mar 31, 2011
Messages
34
Hi Doofusboy,
That didn't work unfortunatley for the listbox issue and still flashes up however, it did resolve another issue I have been working on so thanks very much for your help.
 

Watch MrExcel Video

Forum statistics

Threads
1,114,086
Messages
5,545,878
Members
410,711
Latest member
Josh324
Top