MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 15th, 2002, 06:42 AM   #1
ap1
New Member
 
Join Date: Mar 2002
Posts: 26
Default

i am running a macro and i have included Application.ScreenUpdating = false. Is there a way a message can be displayed saying macro executing please wait.... when the macro is running in the background.
ap1 is offline   Reply With Quote
Old Mar 15th, 2002, 06:47 AM   #2
Guest
 
Posts: n/a
Default

The only possibility I know is to use the status bar (grey bar on the bottom left of the screen, which usually says "Ready").

To change the text of the status bar, use the code

Application.StatusBar = "Any Text"

At the end of your macro, you should put the code

Application.StatusBar = False

otherwise the last message will remain after your macro has ended.
  Reply With Quote
Old Mar 15th, 2002, 07:08 AM   #3
ap1
New Member
 
Join Date: Mar 2002
Posts: 26
Default

Thanks. That helps.
ap1 is offline   Reply With Quote
Old Mar 15th, 2002, 07:14 AM   #4
CRWeaks23
New Member
 
Join Date: Mar 2002
Posts: 48
Default

This may be a little too much than what your asking for, however you could use a user form to create a percentage indicator, just like you see in other windows applications. Create a label on the form and set the background color to something like blue or red. Then just stretch the label within the code after a certain number of statements have been executed. For this to work, simply put your existing macro in the UserForm_Initialize() event, and create a function that will set the bar to a specified length with parameters, and throughout your macro place call statements to this "stretching" procedure. Its a REALLY cool way to show a "working in the background" status bar. If you want more info just post.

Chris
CRWeaks23 is offline   Reply With Quote
Old Mar 15th, 2002, 07:44 AM   #5
ap1
New Member
 
Join Date: Mar 2002
Posts: 26
Default

Ya more info will help thanks
ap1 is offline   Reply With Quote
Old Mar 15th, 2002, 08:33 AM   #6
CRWeaks23
New Member
 
Join Date: Mar 2002
Posts: 48
Default

Ok, I looked all over to find a web page displaying this, with no success. So I will try to explain it the best way i can without writing the code, because it can get rather lengthy...Also note that I told you to place the code in the Initialize event...dont do this! I have a remedy below...

o Build a userform (not to large), and change its Caption property to "ProgBar"

o Add a Frame Control in the center, and name it "FrmProg"

o Add a label control inside of the Frame and make its background color blue, name this LblProg, and change its special effect to frmSpecialEffectRaised

o Now you should have a rectangular Userform, a frame in the center with a long bar inside the frame (the bar is just the label with a blue background)

o Place the following code in the code for the userform, replacing xxx with your prodedure (the one you want to have running in the background while the status bar is in front)
Private Sub UserForm_Activate()
Call xxx
End Sub

o Insert the following code after that:
Sub UpdateProg(Pct)
With ProgBar
.frmProg.Caption = Format(Pct, "0%")
.LblProg.Width = Pct * (.frmProg.Width - 5)
.Repaint
End With
End Sub

o YOUR ALMOST DONE! Now, you want to insert calls to UpdateProg throughout your xxx procedure, the with the parameter Pct equal to the percent your xxx procedure is completed. For example, when the code is 50% done, place "Call UpdateProg(.5)" in your xxx procedure.

o To get it to run, instead of calling the xxx procedure, load the form and show it, NEVER CALLING XXX (this is important). Do this by inserting the following wherever you initially called XXX, call it say ShowProgIndicator:
Sub ShowProgIndicator()
Load frmProg
frmProg.LabelProg.width=0
frmProg.Show
End Sub


WHEW taht was a lot... Remember the key is to situate all teh objects on your form so it looks like a progress bar youve seen before, then run the code...GOOD LUCK!!!

Chris
CRWeaks23 is offline   Reply With Quote
Old Mar 15th, 2002, 09:22 AM   #7
MrExcel
.
 
MrExcel's Avatar
 
Join Date: Feb 2002
Location: Akron, Ohio USA
Posts: 789
Default

I could've sworn someone had this on the 'net, but now I think I remember seeing it in J-Walk's Power Programming with Excel 2000 book - yes pages 396-400.

It is a pretty cool effect - I've used it a few times.

Bill
__________________
Preview my latest book for Free
MrExcel is offline   Reply With Quote
Old Mar 15th, 2002, 09:42 AM   #8
CRWeaks23
New Member
 
Join Date: Mar 2002
Posts: 48
Default

I Knew it was from somewhere because i remember seeing it a while ago. I couldnt find it to post though (I even looked through J-walks site for the Power Programming in VBA book).
CRWeaks23 is offline   Reply With Quote
Old Mar 15th, 2002, 09:42 AM   #9
CRWeaks23
New Member
 
Join Date: Mar 2002
Posts: 48
Default

I'll also note Microsoft actually has a similar version posted on their excel site, but this one is much nicer
CRWeaks23 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 01:00 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes