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 Apr 30th, 2002, 03:32 PM   #1
MERKY
New Member
 
Join Date: Apr 2002
Posts: 38
Default

i have cells where the user will input data and then this data will be transferred to another sheet. I would like to do a presence check to make sure that data has been typed into all the cells. The cells i would like to do this check on are
C3,C5,C7,C9 and C11. Is there any way to do this?
MERKY is offline   Reply With Quote
Old Apr 30th, 2002, 03:35 PM   #2
Jack in the UK
Board Regular
 
Join Date: Feb 2002
Posts: 3,065
Default

hi

Sorry your [rofile does not state loaction, but i keep reading ****presence check****

sorry i do not understand this comments.. need street translation if that ok

is this new Americal expression???? im lost

i guess you mean .. check if new entered data in column has never been entered EXACTLY as is before..

CORRECT?


__________________
Free Excel based Web Toolbar available here.

Jack in the UK
J & R Excel Solutions
"making Excel work for you"
Jack in the UK is offline   Reply With Quote
Old Apr 30th, 2002, 03:42 PM   #3
MERKY
New Member
 
Join Date: Apr 2002
Posts: 38
Default

I NEED TO CHECK TO MAKE SURE THAT THE USER HAS NOT LEFT CELLS BLANK BY ACCIDENT. ALL THE CELLS SHOULD HAVE DATA IN THEM.
MERKY is offline   Reply With Quote
Old Apr 30th, 2002, 03:45 PM   #4
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

What kind of data, Merky?
Dates,Text,Numbers,ect...
One or two or all?
Also, how are you transfering your data?
Macro, I guess?
An event?
Tom

[ This Message was edited by: TsTom on 2002-04-30 14:46 ]
Tom Schreiner is offline   Reply With Quote
Old Apr 30th, 2002, 03:52 PM   #5
MERKY
New Member
 
Join Date: Apr 2002
Posts: 38
Default

the data will be text and it will be transferred using a macro. so far i have this formula(below). but the problem with this is that it only allows me to check cells which are in a list. I want to be able to check cells which are not in a list. For example would like to check cells C5,C7,C9,C20 and C21.
HOW CAN I USE THE FORMULA BELOW BUT TO CHECK THE CELLS I HAVE LISTED ABOVE?


Sub aaa()
Range("B1:B3").Select
ran1 = Range("B1:B3")
rowcount = WorksheetFunction.CountA(ran1)
mycount = Selection.Count
If rowcount <> mycount Then
MsgBox ("make sure that u have entered all the data needed")
End If
End Sub
MERKY is offline   Reply With Quote
Old Apr 30th, 2002, 03:55 PM   #6
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

You can try something like...
'------------------
Sub test()
Dim x As Integer
x = WorksheetFunction.CountA(Range("C3,C5,C7,C9,C11"))

If x = 5 Then
MsgBox "Transfer your cells"
Else
MsgBox "Not all cells filled in. Please retry."
Exit Sub
End If

'rest of your code

End Sub
'-----------------

Bye,
Jay

[ This Message was edited by: Jay Petrulis on 2002-04-30 15:05 ]
Jay Petrulis is offline   Reply With Quote
Old Apr 30th, 2002, 04:12 PM   #7
MERKY
New Member
 
Join Date: Apr 2002
Posts: 38
Default

the formula Jay is good but it doesnt work 100%. he problem is that it only tells the user that they need to fill the cells in if all the cells are blank, but if for example 1 cell is left blank the formula thinks that the user ahas filled in all the cells.

what i need is a formula that will tell arn the user even if they have left one cell empty.

thankz
MERKY is offline   Reply With Quote
Old Apr 30th, 2002, 04:24 PM   #8
Tom Schreiner
Board Regular
 
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
Default

Try...



Sub Validate()
Dim c
For Each c In Range("C3,C5,C7,C9,C11")
If c = "" Then
MsgBox "Please enter data in cell " & c.Address
c.Select
Exit Sub
End If
Next
End Sub



[ This Message was edited by: TsTom on 2002-04-30 15:25 ]
Tom Schreiner is offline   Reply With Quote
Old Apr 30th, 2002, 04:52 PM   #9
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Merky,

Select the target cells one by one while you hold the control key pressed. Then go to the Name Box on the Formula Bar, type Irange, and hit enter.

Enter in some cell:

=COUNTA(Irange)=5

This formula will give FALSE if any of the cells is left empty by the user; if all filled, you get TRUE.

The macro should look at this cell before transferring the data from these cells to a target sheet. That's something I leave to macro coders.

Hope this is what you want.

One thing though: There is no need for all in capitals. Many people "read" that as shouting. & it's hard to read.

Cheers.

Aladin

Aladin Akyurek is offline   Reply With Quote
Old Apr 30th, 2002, 05:00 PM   #10
MERKY
New Member
 
Join Date: Apr 2002
Posts: 38
Default

Thankz to all the people who helped me on this problem. Dam, u guys must be proper smart. Anyhow , thankz.
MERKY 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:51 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