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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

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,113,777
Messages
5,544,174
Members
410,596
Latest member
JoeyZ
Top