Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Progress bar & explanation of code

Hello again, I've found some code on the net which is exactly what I need bar
a progress bar. But I've tried and failed in including one in this
example....Is there a way? I got confused because the counter variable is
already being manipulated...and can anyone explain why nothing has been
declared? I have the whole file for anyone who is interested.

Many thanks in advance

M1keHailu

Do While Not IsEmpty(Sheets("return").Cells(1, colr))
colx = getcolumnofselectedcompany(Sheets("return").Cells( 1, colr))
tot = 0
Counter = 0
Application.ScreenUpdating = False

If OptLogRet.Value = True Then
rowx = 3
Do While Not IsEmpty(Sheets("Return").Cells(rowx, 1))
Sheets("Return").Cells(rowx, colr) =
(Log(Sheets("portfolio").Cells(rowx + 1, colx)) -
Log(Sheets("portfolio").Cells(rowx, colx)))
tot = tot + Sheets("Return").Cells(rowx, colr)
Counter = Counter + 1
rowx = rowx + 1
Loop
End If

If OptSimRet.Value = True Then
rowx = 3
Do While Not IsEmpty(Sheets("Return").Cells(rowx, 1))
Sheets("Return").Cells(rowx, colr) =
(Sheets("portfolio").Cells(rowx + 1, colx) - Sheets("portfolio").Cells(rowx,
colx)) / Sheets("portfolio").Cells(rowx, colx)
tot = tot + Sheets("Return").Cells(rowx, colr)
Counter = Counter + 1
rowx = rowx + 1
Loop
End If
Columns(colr).AutoFit

Sheets("Return").Cells(398, colr).Value = tot / Counter

colr = colr + 1
Loop
Application.ScreenUpdating = True



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Progress bar & explanation of code

It appears you are updating a worksheet cell.
It so, you must have ScreenUpdating set to True while the code is running.
--
Jim Cone
Portland, Oregon USA



"M1kehailu"

wrote in message
Hello again, I've found some code on the net which is exactly what I need bar
a progress bar. But I've tried and failed in including one in this
example....Is there a way? I got confused because the counter variable is
already being manipulated...and can anyone explain why nothing has been
declared? I have the whole file for anyone who is interested.
Many thanks in advance
M1keHailu

Do While Not IsEmpty(Sheets("return").Cells(1, colr))
colx = getcolumnofselectedcompany(Sheets("return").Cells( 1, colr))
tot = 0
Counter = 0
Application.ScreenUpdating = False

If OptLogRet.Value = True Then
rowx = 3
Do While Not IsEmpty(Sheets("Return").Cells(rowx, 1))
Sheets("Return").Cells(rowx, colr) =
(Log(Sheets("portfolio").Cells(rowx + 1, colx)) -
Log(Sheets("portfolio").Cells(rowx, colx)))
tot = tot + Sheets("Return").Cells(rowx, colr)
Counter = Counter + 1
rowx = rowx + 1
Loop
End If

If OptSimRet.Value = True Then
rowx = 3
Do While Not IsEmpty(Sheets("Return").Cells(rowx, 1))
Sheets("Return").Cells(rowx, colr) =
(Sheets("portfolio").Cells(rowx + 1, colx) - Sheets("portfolio").Cells(rowx,
colx)) / Sheets("portfolio").Cells(rowx, colx)
tot = tot + Sheets("Return").Cells(rowx, colr)
Counter = Counter + 1
rowx = rowx + 1
Loop
End If
Columns(colr).AutoFit

Sheets("Return").Cells(398, colr).Value = tot / Counter
colr = colr + 1
Loop
Application.ScreenUpdating = True
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
Need explanation of code please glensfallslady Excel Programming 1 November 1st 06 08:33 PM
Explanation needed for CopyAllModules code davidm Excel Programming 5 July 13th 05 10:21 PM
Explanation of code Matt Excel Programming 3 January 15th 04 12:12 PM
Explanation of code marksuza Excel Programming 2 November 21st 03 11:45 AM
Code for a progress dialog?? lifter10101010 Excel Programming 2 November 10th 03 03:47 PM


All times are GMT +1. The time now is 01:18 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"