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 May 7th, 2002, 01:46 PM   #1
Lt. Krul
New Member
 
Join Date: May 2002
Posts: 31
Default

My Timesheet contains rows for Project Codes and Hours spent during the week with the end cell calculating the hours for that project.
I need a way to Keep users from entering hours on a row (which results in a calculated last row with value <>0)without selecting a Jobcode first. A message would pop up warning "Any time spent must have an associated Job code. Please enter Job code."

Any Help here would be appreciated.
Lt. Krul is offline   Reply With Quote
Old May 7th, 2002, 01:57 PM   #2
James
Board Regular
 
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
Default

Can you supply us with a little more info?
cell addresses etc?

James
James is offline   Reply With Quote
Old May 7th, 2002, 01:59 PM   #3
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

Excel has a built in functioon for this very purpose called data validation.

Let me give you an example.
Lets say you want A1>0 before you allow a user to enter anything into B1. then do the following.
1- select B1
2- goto toolbar
3- now select data.. validation
4- data validation window will popup
6- in the "allow" drop down select "custom"
7- in the "formula" txtbx type "=A1>0"
8- select the "error alert" tab
9- type in the message you want displayed when someone does not enter data to A1 first.

Boomba ... your done !
Nimrod is offline   Reply With Quote
Old May 7th, 2002, 02:04 PM   #4
datastream
New Member
 
Join Date: Apr 2002
Location: Kansas City, MO
Posts: 14
Default

I'm not sure of a function in a worksheet that would check the value in another cell first.

You could create a macro with an input box, checking the validity of the inputs and then automatically posting the results on the sheet. If the user entered hours or project code alone, your message could pop up and keep them from posting without complete information.
datastream is offline   Reply With Quote
Old May 7th, 2002, 02:40 PM   #5
Lt. Krul
New Member
 
Join Date: May 2002
Posts: 31
Default

Nimrod, I like your Idea, but unfortunately I tried it with some glitches...
My A1 is already a validated list from another sheet, and the cell is formated for text. my B1 cell is really B1 through B5.
I'm not very good at function language, so If you could take another shot at this I think we'll have it.

Thanks.
Lt. Krul is offline   Reply With Quote
Old May 7th, 2002, 02:44 PM   #6
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

1- Tell me exactly which cell should be tested. ie. A1 etc. In other words which cell needs to have a value first. I.e. cell position for job code.
2- tell me exactly what value will be in the cell
3- What cell will be the cell your testing from.
I will work the formula from that

[ This Message was edited by: Nimrod on 2002-05-07 13:46 ]

[ This Message was edited by: Nimrod on 2002-05-07 13:48 ]
Nimrod is offline   Reply With Quote
Old May 7th, 2002, 02:57 PM   #7
Lt. Krul
New Member
 
Join Date: May 2002
Posts: 31
Default

Nimrod - good to see you...

1. A1 needs to have something in it before I'll let the other cells (b1 through b5) allowed values.

2. A1 itself is allowed (via validation) only text values from a list on another sheet (such as "01", "Admin.", "VA" and the like) there are 43 allowable values for A1.

3. Cells B1 through B5 are the ones I'm selecting prior to click the DATA VALIDATION menu. These cells are numbers (hours, like 5.0 or 3.5)

Thanks...
Lt. Krul is offline   Reply With Quote
Old May 7th, 2002, 03:48 PM   #8
lenze
MrExcel MVP
 
lenze's Avatar
 
Join Date: Feb 2002
Location: Helena, MT
Posts: 13,690
Default

I'm sure Nimrod will come up with a way using data validation, but you could also use this code

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B1:B5")) Is Nothing Then
If Range("$A$1").Value = "" Then MsgBox ("You can't do that")
End If
End Sub

Place in the WorkSheet Module

[ This Message was edited by: lenze on 2002-05-07 14:54 ]
lenze is offline   Reply With Quote
Old May 7th, 2002, 06:55 PM   #9
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

Nimrod is offline   Reply With Quote
Old May 7th, 2002, 07:03 PM   #10
Nimrod
MrExcel MVP
 
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
Default

Hi Krul:
Sorry to take so long but I was at work and got called into .... action ...
Anyway here is the validation formula that will work: =NOT(ISBLANK($A$1))

You will put this in your validation window for cells B1 to B5.

IMPORTANT: Since you want this rule to fire even when the evaluation cell is blank (i.e. A1) make sure you UNCHECK the "ignore blank" option in the validation window. If you don't uncheck this the rule will not be fired when A1 is empty.

Remember to enter a "error alert" message in the validation window as well.

[ This Message was edited by: Nimrod on 2002-05-07 18:03 ]
Nimrod 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 11:16 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