Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default ScreenUpdating and listboxes

I'm populating listboxes and want to reduce screen flicker. If I populate
them between the screenupdating=false and screenupdating=true commands, the
items in the listboxes aren't displayed. If I don't use the screenupdating
commands all of the objects on the page flicker each time a line is added to
the listbox. Is there a way to see these items wihle still eliminating the
flicker?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default ScreenUpdating and listboxes

It will be easier to help if you post the code you're using to populate them.

"Merlynsdad" wrote:

I'm populating listboxes and want to reduce screen flicker. If I populate
them between the screenupdating=false and screenupdating=true commands, the
items in the listboxes aren't displayed. If I don't use the screenupdating
commands all of the objects on the page flicker each time a line is added to
the listbox. Is there a way to see these items wihle still eliminating the
flicker?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default ScreenUpdating and listboxes

Here's the code:

Application.ScreenUpdating = False

Set wsq = ActiveSheet

Me.Activate
lstEmpFrom.Clear
lstEmpTo.Clear

'Make the EmpMonDates collection

On Error Resume Next
For Each cell In wsq.Range("$b$17:$b$100")
EmpMonDates.Add cell.Value, CStr(cell.Value)
Next cell

'Sort the EmpMonDates collection

For i = 1 To EmpMonDates.Count - 1
For j = i + 1 To EmpMonDates.Count
If EmpMonDates(i) EmpMonDates(j) Then
Swap1 = EmpMonDates(i)
Swap2 = EmpMonDates(j)
EmpMonDates.Add Swap1, befo=j
EmpMonDates.Add Swap2, befo=i
EmpMonDates.Remove i + j
EmpMonDates.Remove j + i
End If
Next j
Next i

On Error GoTo 0

'Add the dates to the list boxes

For Each Item In EmpMonDates
ActiveSheet.lstEmpFrom.AddItem Item
ActiveSheet.lstEmpTo.AddItem Item
Next Item
Application.ScreenUpdating = True

"B Lynn B" wrote:

It will be easier to help if you post the code you're using to populate them.

"Merlynsdad" wrote:

I'm populating listboxes and want to reduce screen flicker. If I populate
them between the screenupdating=false and screenupdating=true commands, the
items in the listboxes aren't displayed. If I don't use the screenupdating
commands all of the objects on the page flicker each time a line is added to
the listbox. Is there a way to see these items wihle still eliminating the
flicker?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default ScreenUpdating and listboxes

Here's the code:

Application.ScreenUpdating = False
Set wsq = ActiveSheet

Me.Activate
lstEmpFrom.Clear
lstEmpTo.Clear

'Make the EmpMonDates collection

On Error Resume Next
For Each cell In wsq.Range("$b$17:$b$100")
EmpMonDates.Add cell.Value, CStr(cell.Value)
Next cell

'Sort the EmpMonDates collection

For i = 1 To EmpMonDates.Count - 1
For j = i + 1 To EmpMonDates.Count
If EmpMonDates(i) EmpMonDates(j) Then
Swap1 = EmpMonDates(i)
Swap2 = EmpMonDates(j)
EmpMonDates.Add Swap1, befo=j
EmpMonDates.Add Swap2, befo=i
EmpMonDates.Remove i + j
EmpMonDates.Remove j + i
End If
Next j
Next i

On Error GoTo 0

'Add the dates to the list boxes

For Each Item In EmpMonDates
ActiveSheet.lstEmpFrom.AddItem Item
ActiveSheet.lstEmpTo.AddItem Item
Next Item
Application.ScreenUpdating = True

"B Lynn B" wrote:

It will be easier to help if you post the code you're using to populate them.

"Merlynsdad" wrote:

I'm populating listboxes and want to reduce screen flicker. If I populate
them between the screenupdating=false and screenupdating=true commands, the
items in the listboxes aren't displayed. If I don't use the screenupdating
commands all of the objects on the page flicker each time a line is added to
the listbox. Is there a way to see these items wihle still eliminating the
flicker?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
listboxes Zaahir Excel Programming 1 January 16th 07 12:26 PM
Problems with listboxes in connection with screenupdating = false Mats Nilsson Excel Programming 0 November 27th 06 03:11 PM
Need help with Listboxes! Angelus[_2_] Excel Programming 4 January 24th 06 04:50 AM
Listboxes 2 Denise Excel Programming 2 June 8th 04 06:39 PM
listboxes Mandy[_2_] Excel Programming 3 May 7th 04 04:38 PM


All times are GMT +1. The time now is 03:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"