Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need explanation of code please | Excel Programming | |||
Explanation needed for CopyAllModules code | Excel Programming | |||
Explanation of code | Excel Programming | |||
Explanation of code | Excel Programming | |||
Code for a progress dialog?? | Excel Programming |