E
ExcelMonkey
I just put a status bar within a loop. When I run it with the status
bar it takes 1 minute and 55 seconds. When I comment out the statusbar
logic it takes 6 seconds. I didn't realize how much memory the status
bar takes within large loops(10,000X244). Is there a way to only run
the status bar every nth loop?
AMax = 10000
BMax = 244
ReDim DataArray(1 To AMax, 1 To BMax)
StartTime = Now()
For A = 1 To AMax
For B = 1 To BMax
Randomize
RandomVar = Rnd()
DataArray(A, B) = RandomVar
Application.StatusBar = "Filling VBA Array " & (A * BMax -
(BMax - B)) / (AMax * BMax) * 100 & "%."
Next B
Next A
bar it takes 1 minute and 55 seconds. When I comment out the statusbar
logic it takes 6 seconds. I didn't realize how much memory the status
bar takes within large loops(10,000X244). Is there a way to only run
the status bar every nth loop?
AMax = 10000
BMax = 244
ReDim DataArray(1 To AMax, 1 To BMax)
StartTime = Now()
For A = 1 To AMax
For B = 1 To BMax
Randomize
RandomVar = Rnd()
DataArray(A, B) = RandomVar
Application.StatusBar = "Filling VBA Array " & (A * BMax -
(BMax - B)) / (AMax * BMax) * 100 & "%."
Next B
Next A