LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Listbox problems

I have a procedure that starts out with:

Call stopautocalc
Worksheets("Estimates").Unprotect Password:="6573"
Worksheets("Estimates DB").Unprotect Password:="6573"
Worksheets("Cost Items DB").Unprotect Password:="6573"

****code****

Worksheets("Estimates").Protect Password:="6573"
Worksheets("Estimates DB").Protect Password:="6573"
Worksheets("Cost Items DB").Protect Password:="6573"
Call startautocalc

Call loadlistbox

End Sub

The code for stopautocalc and startautocalc a

Sub stopautocalc()
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With
End Sub

Sub startautocalc()
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlCalculationAutomatic
End With
End Sub

The code for loadlistbox is:

Sub loadlistbox()
Dim est As String
Dim xcell As Range
Dim fcell As Range
Dim rng As Range
Dim a As String
Dim i As Long
Dim num As Long

Worksheets("Estimates").ListBox1.Clear
Set xcell = Range("estlnkdb")
Set rng = Range(xcell.Offset(0, 1), xcell.Offset(0, 130))
est = Range("currentestimate")
With rng
Set fcell = .Find(what:=est, LookIn:=xlValues, lookat:=xlWhole, _
searchorder:=xlByColumns)
End With

num = fcell.Offset(0, 1)
For i = 1 To num
a = fcell.Offset(i, 0)
With Worksheets("Estimates").ListBox1
.AddItem a
End With
Next

End Sub

I am having problems loading listbox1. When Call stopautocalc is before
unprotecting worksheets the listbox is not loaded. If I put Call
stopautocalc after the uprotectsheets the listbox is loaded. I would like to
have stopautocalc before unprotect sheets so the screen doesn't flash. How
can I make this work?
Thanks


 
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
Listindex problems in multicolumn listbox [email protected] Excel Programming 0 August 18th 06 11:02 PM
UserForms:listbox display problems Emilie Excel Programming 0 March 23rd 05 04:17 PM
Problems with setting values in a listbox kankal Excel Programming 1 November 26th 04 09:12 AM
problems resetting backcolor in listbox Kelley[_3_] Excel Programming 0 November 1st 04 10:23 PM
Excell FileOPenDialog from another App, and listbox multiselect problems What-a-Tool Excel Programming 6 October 2nd 04 02:29 PM


All times are GMT +1. The time now is 11:56 PM.

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"