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 Feb 28th, 2002, 01:22 PM   #1
Arash_The_A_Level_Student
New Member
 
Join Date: Feb 2002
Posts: 38
Default

I want my excel template after every 250 processes to notify me a message (eg. Save To CD writer) does anyone know how to do this?
Arash_The_A_Level_Student is offline   Reply With Quote
Old Feb 28th, 2002, 01:29 PM   #2
Russell Hauf
MrExcel MVP
 
Russell Hauf's Avatar
 
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
Default

What constitutes a "process"?
Russell Hauf is offline   Reply With Quote
Old Feb 28th, 2002, 01:32 PM   #3
Arash_The_A_Level_Student
New Member
 
Join Date: Feb 2002
Posts: 38
Default

A process for example I data on a built-in data form and it copies that sends it to my invoice, well after every say 100 times it does this I would like it to notify me that it has done 250 process with a message box
Arash_The_A_Level_Student is offline   Reply With Quote
Old Feb 28th, 2002, 01:39 PM   #4
Arash_The_A_Level_Student
New Member
 
Join Date: Feb 2002
Posts: 38
Default

*100 sorry
Arash_The_A_Level_Student is offline   Reply With Quote
Old Feb 28th, 2002, 02:02 PM   #5
gplhl
Board Regular
 
Join Date: Feb 2002
Location: Chippenham, UK
Posts: 136
Default

Quote:
On 2002-02-28 12:32, Arash_The_A_Level_Student wrote:
A process for example I data on a built-in data form and it copies that sends it to my invoice, well after every say 100 times it does this I would like it to notify me that it has done 250 process with a message box
This process, is this done with a Macro?

If so add a variable, initialise it to zero and add 1 every time the macro is run. Then use:

If myVariable = 250 Then

MsgBox("Your Message")
myVariable = 0
End If


Would the messagebox only be required after 250 times no matter where the process was by the time that the workbook was closed or would you like to also show the message on closing the workbook?

Would the counting need to start from 1 when the workbook was opened or would it need to continue on from when the workbook was last saved?



__________________
Regards,

Gary Hewitt-Long
gplhl is offline   Reply With Quote
Old Feb 28th, 2002, 02:31 PM   #6
Arash_The_A_Level_Student
New Member
 
Join Date: Feb 2002
Posts: 38
Default

sorry stupid question I know nothing about VBA but how do you add a variable?
Arash_The_A_Level_Student is offline   Reply With Quote
Old Feb 28th, 2002, 03:47 PM   #7
hennahairgel
New Member
 
hennahairgel's Avatar
 
Join Date: Feb 2002
Location: Bristol, England
Posts: 39
Default

right at the beginning, before the fist sub write

dim processcount string

then at end of variable write

if processcount = 250 then
save bit goes in here

processcount =250
else
processcount - processcount + 1

hope this is what you want.
Henry
hennahairgel is offline   Reply With Quote
Old Feb 28th, 2002, 03:48 PM   #8
hennahairgel
New Member
 
hennahairgel's Avatar
 
Join Date: Feb 2002
Location: Bristol, England
Posts: 39
Default

sorry
dim processcount as string
hennahairgel is offline   Reply With Quote
Old Mar 1st, 2002, 12:05 PM   #9
Joe Was
MrExcel MVP
 
Joe Was's Avatar
 
Join Date: Feb 2002
Location: Central Florida, USA
Posts: 7,541
Default

Right click a sheet tab lable, then select "View Code" from the list on your left dubble click "ThisWorkBook" and paste a copy of this code on to the sheet on your right. Hope this helps. JSW

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Dim myTest As Integer
Static x As Integer
'By: Joe Was, 2/2002

x = x + 1
myTest = x
If myTest >= 250 Then
MsgBox "Time to Save"
x = 0
Else
GoTo myEnd
End If
myEnd:

End Sub

Thanks for the edit Gary, forgot the reset, was about to re-submit an updated copy and saw your post, thanks. JSW

[ This Message was edited by: Joe Was on 2002-03-01 13:37 ]

[ This Message was edited by: Joe Was on 2002-03-01 13:39 ]
Joe Was is offline   Reply With Quote
Old Mar 1st, 2002, 12:38 PM   #10
gplhl
Board Regular
 
Join Date: Feb 2002
Location: Chippenham, UK
Posts: 136
Default

Quote:
On 2002-03-01 11:05, Joe Was wrote:
Right click a sheet tab lable, then select "View Code" from the list on your left dubble click "ThisWorkBook" and paste a copy of this code on to the sheet on your right. Hope this helps. JSW

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Dim myTest As Integer
Static x As Integer
'By: Joe Was, 2/2002

x = x + 1
myTest = x
If myTest >= 250 Then
MsgBox "Time to Save"
Else
GoTo myEnd
End If
myEnd:

End Sub
You need to reset x to 0 after the message box has been shown otherwise x will always be >=250

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
Dim myTest As Integer
Static x As Integer
'By: Joe Was, 2/2002

x = x + 1
myTest = x
If myTest >= 250 Then
MsgBox "Time to Save"
x = 0
Else
GoTo myEnd
End If
myEnd:

End Sub
__________________
Regards,

Gary Hewitt-Long
gplhl 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 02:09 AM.


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