Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Listbox displaying incorrectly on opening worksheet

Hi,

I have a Listbox. When I first open the spreadsheet, the Listbox
values text don't visually appear. I can click on the spots in the
listbox where the text is and thereafter it appears. Alternately, if
I switch tabs and then come back it also shows properly.

It seems to be due to ScreenUpdating; however I do this after the
values have been populated (same result putting it before). If the
ScreenUpdating portion is completely removed, it displays the values
text properly. However, I'd prefer to have ScreenUpdating disabled
for the second section of code.

I'm populating the values in Workbook_Open, code as below.

Thanks, Scott

-------------------------------------------------------

Private Sub Workbook_Open()
Dim i As Long

'Application.ScreenUpdating = False '<== Initial position of
ScreenUpdating

With wksMomMpaScatter
For i = 0 To ReportPlantsInfo.Range("ReportPlantListFull").Coun t -
1
.ListBox1.AddItem
ReportPlantsInfo.Range("ReportPlantListFull").Cell s(i + 1, 1)
.ListBox1.Selected(i) =
ReportPlantsInfo.Range("ReportPlantListFull").Offs et(0, 1).Cells(i +
1, 1)
Next i
End With

Application.ScreenUpdating = False '<== Alternate position for
ScreenUpdating

.... {Other code} ....

Application.ScreenUpdating = True

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Listbox displaying incorrectly on opening worksheet

hi Scott,

the file is it in shared mode ?


--
isabelle

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Listbox displaying incorrectly on opening worksheet

sorry for my poor english,

does this file is in shared mode ?


--
isabelle

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Listbox displaying incorrectly on opening worksheet

If it's just a display problem -- and it sounds like it is, since the program
works fine if the screenupdating portion is removed...

Maybe you can add a change sheet and change back at the bottom of your code.

And if that fails, do it with screen updating on. You'll have a bit of
flashing, but at least it'll show correctly.





On 11/25/2011 18:05, Scott wrote:
Hi,

I have a Listbox. When I first open the spreadsheet, the Listbox
values text don't visually appear. I can click on the spots in the
listbox where the text is and thereafter it appears. Alternately, if
I switch tabs and then come back it also shows properly.

It seems to be due to ScreenUpdating; however I do this after the
values have been populated (same result putting it before). If the
ScreenUpdating portion is completely removed, it displays the values
text properly. However, I'd prefer to have ScreenUpdating disabled
for the second section of code.

I'm populating the values in Workbook_Open, code as below.

Thanks, Scott

-------------------------------------------------------

Private Sub Workbook_Open()
Dim i As Long

'Application.ScreenUpdating = False '<== Initial position of
ScreenUpdating

With wksMomMpaScatter
For i = 0 To ReportPlantsInfo.Range("ReportPlantListFull").Coun t -
1
.ListBox1.AddItem
ReportPlantsInfo.Range("ReportPlantListFull").Cell s(i + 1, 1)
.ListBox1.Selected(i) =
ReportPlantsInfo.Range("ReportPlantListFull").Offs et(0, 1).Cells(i +
1, 1)
Next i
End With

Application.ScreenUpdating = False '<== Alternate position for
ScreenUpdating

.... {Other code} ....

Application.ScreenUpdating = True

End Sub


--
Dave Peterson
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
my formated column is displaying one cell incorrectly jungbugg40 Excel Worksheet Functions 2 January 6th 10 07:51 PM
Number of Copies for worksheet defaults to 5 incorrectly [email protected] Excel Discussion (Misc queries) 1 May 22nd 07 04:18 PM
Why are my nested sub-totals are displaying incorrectly? chiefdean13 Excel Discussion (Misc queries) 1 July 20th 05 05:45 AM
DISPLAYING INFO IN A LISTBOX [email protected] Excel Programming 1 February 28th 05 01:19 PM
Displaying a specific worksheet on opening application John Excel Programming 1 February 19th 04 12:27 PM


All times are GMT +1. The time now is 02:49 AM.

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

About Us

"It's about Microsoft Excel"