Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Calculations

Hello,

I have written a macro which performs some lengthy calculations. I run the
macro then tell excel to calculate. Running the macro takes about 10 seconds,
calculating takes up to 1 minute. I want to display a progress bar to show
the calculation progress so the user knows the program hasn't crashed.
Obviously this is displayed in the bottom left hand corner but is it possible
to display it more obviously?

Many Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Calculations


"Neil Hopkinson" schrieb im
Newsbeitrag ...
Hello,

I have written a macro which performs some lengthy calculations. I run the
macro then tell excel to calculate. Running the macro takes about 10
seconds,
calculating takes up to 1 minute. I want to display a progress bar to show
the calculation progress so the user knows the program hasn't crashed.
Obviously this is displayed in the bottom left hand corner but is it
possible
to display it more obviously?

Many Thanks


Hi Neil,

google is your friend, "excel vba progress bar" gets you started, e.g.
http://www.cpearson.com/excel/Progress.htm.

cheers,
Stephan


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Calculations

This is great, thanks! However I can write the progressbar but the issue is
how to pick up the percentage that has been calculated once automatic
calculation is switched back on. Any ideas on this?

Thanks


"Dr. Stephan Kassanke" wrote:


"Neil Hopkinson" schrieb im
Newsbeitrag ...
Hello,

I have written a macro which performs some lengthy calculations. I run the
macro then tell excel to calculate. Running the macro takes about 10
seconds,
calculating takes up to 1 minute. I want to display a progress bar to show
the calculation progress so the user knows the program hasn't crashed.
Obviously this is displayed in the bottom left hand corner but is it
possible
to display it more obviously?

Many Thanks


Hi Neil,

google is your friend, "excel vba progress bar" gets you started, e.g.
http://www.cpearson.com/excel/Progress.htm.

cheers,
Stephan



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Calculations

Neil Hopkinson wrote:
Hello,

I have written a macro which performs some lengthy calculations. I run the
macro then tell excel to calculate. Running the macro takes about 10 seconds,
calculating takes up to 1 minute. I want to display a progress bar to show
the calculation progress so the user knows the program hasn't crashed.
Obviously this is displayed in the bottom left hand corner but is it possible
to display it more obviously?

Many Thanks



The low-tech solution is to just write a status message out to a visible, unused
cell on your worksheet and update it each pass through the loop. Make it in
color if you wish to be more eye-catching. There are various reasons this won't
work for all cases, but when this approach does fit your problem it's dirt
simple to do.

Bill
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 611
Default Calculations

Bill,

Chip Pearson has a progress bar at www.cpearson.com
--
Earl Kiosterud
www.smokeylake.com

"Bill Martin -- (Remove NOSPAM from address)"
wrote in message ...
Neil Hopkinson wrote:
Hello,

I have written a macro which performs some lengthy calculations. I run
the macro then tell excel to calculate. Running the macro takes about 10
seconds, calculating takes up to 1 minute. I want to display a progress
bar to show the calculation progress so the user knows the program hasn't
crashed. Obviously this is displayed in the bottom left hand corner but
is it possible to display it more obviously?

Many Thanks



The low-tech solution is to just write a status message out to a visible,
unused cell on your worksheet and update it each pass through the loop.
Make it in color if you wish to be more eye-catching. There are various
reasons this won't work for all cases, but when this approach does fit
your problem it's dirt simple to do.

Bill





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Calculations

Earl Kiosterud wrote:
Bill,

Chip Pearson has a progress bar at www.cpearson.com
--
Earl Kiosterud
www.smokeylake.com


I understand, and I have played with it. It's great. It also requires more of
the user to know how to load it, declare variables, etc. If you're up to that
it's great. Some users here aren't always at that level though and a dirt
simple approach is occasionally useful as an alternative -- IMHO. Stephan had
already mentioned Chip's progress bar approach so I just thought I'd point out a
different one.

Bill
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Calculations

Thanks for this info. Very useful. One further question though. Do you know
if it is possible to pick up the percentage that has been calculated once
autocalculate is switched back on?

Thanks

"Bill Martin -- (Remove NOSPAM from addre" wrote:

Earl Kiosterud wrote:
Bill,

Chip Pearson has a progress bar at www.cpearson.com
--
Earl Kiosterud
www.smokeylake.com


I understand, and I have played with it. It's great. It also requires more of
the user to know how to load it, declare variables, etc. If you're up to that
it's great. Some users here aren't always at that level though and a dirt
simple approach is occasionally useful as an alternative -- IMHO. Stephan had
already mentioned Chip's progress bar approach so I just thought I'd point out a
different one.

Bill

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Calculations

Neil Hopkinson wrote:
Thanks for this info. Very useful. One further question though. Do you know
if it is possible to pick up the percentage that has been calculated once
autocalculate is switched back on?


I don't know what you're doing specifically, but in general the answer is yes.
I've often written macros where I turn off autocalc, then do a bunch of macro
manipulation, then briefly turn the autocalc back on then off again and use some
spreadsheet answer back into the macro again.

Specifically where I've written Monte Carlo analysis so at the end of a loop
autocalc is briefly turned on to get the result, compare it with the last pass,
and then go into the next analysis pass. After each pass I can see a bunch of
things the macro has updated on the spreadsheet get visibly updated that way and
tell how much progress the Monte Carlo is making. Whether to let it continue to
run a few more hours or to shut it down and tweak the algorithm somehow.

Bill
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 611
Default Calculations

Bill,

Oops. My bad (whatever exactly that means <g). I thought I was replying
to the OP, which doesn't show up in my newsreader, OE, as happens sometimes.

While I'm here, since I can't reply to the OP anyway, here's a simple little
progress bar I made years ago. I admitted even then in my comments that
it's dorky. It could be put into text box on the worksheet or UserForm or a
cell (where it works best with a non-proportional font like Courier), or the
Status bar, etc.

WorkToDo = 20 ' 20 units of work - also sets length of char string of
progress bar
WorkDone = 5 ' update as routine runs, 0 to WorkToDo

ProgressIndicator = String$(WorkDone, "+") & String$(WorkToDo - WorkDone,
"-")

Range("PB") = ProgressIndicator
ActiveSheet.TextBox1.Text = ProgressIndicator : DoEvents
Application.StatusBar = ProgressIndicator

Maybe someone can use it.
--
Earl Kiosterud
www.smokeylake.com

"Bill Martin -- (Remove NOSPAM from address)"
wrote in message ...
Earl Kiosterud wrote:
Bill,

Chip Pearson has a progress bar at www.cpearson.com
--
Earl Kiosterud
www.smokeylake.com


I understand, and I have played with it. It's great. It also requires
more of the user to know how to load it, declare variables, etc. If
you're up to that it's great. Some users here aren't always at that level
though and a dirt simple approach is occasionally useful as an
alternative -- IMHO. Stephan had already mentioned Chip's progress bar
approach so I just thought I'd point out a different one.

Bill



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
MPG Calculations Terry Bennett Excel Worksheet Functions 8 June 10th 08 10:17 PM
Calculations Rich D Excel Discussion (Misc queries) 2 October 2nd 07 06:09 PM
Calculations J. McGonigal Excel Worksheet Functions 4 April 25th 06 07:53 AM
how many calculations? Amie Excel Worksheet Functions 0 April 21st 06 08:04 PM
Between calculations Dan Wilson Excel Worksheet Functions 10 March 15th 05 05:06 PM


All times are GMT +1. The time now is 11:22 AM.

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"