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 16th, 2002, 06:49 PM   #1
PatMc
New Member
 
Join Date: Apr 2002
Location: Oakland
Posts: 5
Default

I'm creating a budgeting template that consists of 10 identical sheets (labeled Sheet1, Sheet2, etc.). Each sheet allows me to enter staff, materials, etc. for each phase of a project.

I need to create a client report sheet, which pulls data from each sheet. That's easy. What I can't figure out is...

How can I have the client report sheet ignore sheets that don't have anything on them? The algorithm is something like this:

if cell g38 on sheet1 = 0 then ignore this one and go to the next sheet, else pull the data into the report.

I'm hoping that the report sheet will flow smoothly (without gaps for missing sheets).

Any suggestions?
PatMc is offline   Reply With Quote
Old Apr 16th, 2002, 07:15 PM   #2
Jay Petrulis
MrExcel MVP
 
Jay Petrulis's Avatar
 
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
Default

Quote:
On 2002-04-16 17:49, PatMc wrote:
I'm creating a budgeting template that consists of 10 identical sheets (labeled Sheet1, Sheet2, etc.). Each sheet allows me to enter staff, materials, etc. for each phase of a project.

I need to create a client report sheet, which pulls data from each sheet. That's easy. What I can't figure out is...

How can I have the client report sheet ignore sheets that don't have anything on them? The algorithm is something like this:

if cell g38 on sheet1 = 0 then ignore this one and go to the next sheet, else pull the data into the report.

I'm hoping that the report sheet will flow smoothly (without gaps for missing sheets).

Any suggestions?
Can you give more details? What data/how laid out on each sheet?

A number of possiblities come to mind, but need to know more information. Most likely, with this many sheets and not all identically set up, a macro would be best.

Jay
Jay Petrulis is offline   Reply With Quote
Old Apr 17th, 2002, 12:16 AM   #3
PatMc
New Member
 
Join Date: Apr 2002
Location: Oakland
Posts: 5
Default

OK, here are the details. On each of the 10 sheets (named "Sheet1", "Sheet2", etc.), I have a text string in cell A3 and a dollar amount in cell G38. Now, it's possible that on a given project, I might use Sheet1, Sheet2, Sheet6, and Sheet8 ONLY.

What I want to do is make it so that on my "Report" sheet, it checks each sheet to see if cell G38>0. If so, it will pull data from A3 and G38 and compile it on the Report sheet.

For the sake of discussion, let's say that the data will go into two columns on the report sheet. So, for example...
Sheet1!A3 will go into Report!A1
Sheet1!G38 goes into Report!A2
Sheet2!A3 goes into Report!B1
Sheet2!G38 goes into Report!B2

Now here's the tricky part...

Sheet3, Sheet4, Sheet5 are unused for this example project, so...

Sheet6!A3 goes into Report!C1
Sheet6!G38 goes into Report!C2

Sheet7 is unused, so the report ignores it.

Sheet8!A3 goes into Report!D1
Sheet8!G38 goes into Report!D2

Sheet9 and Sheet10 are unused and ignored by Report.

And finally, a sum of A2:D2 goes into E2.

I hope that's clear (and possible).

Thanks for your help.

PatMc is offline   Reply With Quote
Old Apr 17th, 2002, 12:20 AM   #4
PatMc
New Member
 
Join Date: Apr 2002
Location: Oakland
Posts: 5
Default

Oops... it's been a long day. In my example, I screwed up how I described which cells the data gets plugged into.

It'll be two columns...

A1, B1
A2, B2
A3, B3
A4, B4

with the sum of the B column in B5.

Sorry for the confusion on my part.
PatMc is offline   Reply With Quote
Old Apr 17th, 2002, 10:23 AM   #5
PatMc
New Member
 
Join Date: Apr 2002
Location: Oakland
Posts: 5
Default

Another approach occurred to me, though I don't know quite how to do this either. Instead of selectively pulling the data to the report sheet, perhaps it ALL is linked in... BUT, if a row contains a 0 value in column B, the entire row is hidden (or deleted).

I know I could create a macro to hide a row, but there needs to be the evaluation of the value in column B to decided whether to hide it or not. I don't know how to do that.

PatMc is offline   Reply With Quote
Old Apr 17th, 2002, 11:19 AM   #6
PatMc
New Member
 
Join Date: Apr 2002
Location: Oakland
Posts: 5
Default

Got it! I figured it out...

Sub hideRow()

For counter = 4 To 13
If Cells(counter, 2).Value = 0 Then
Rows(counter).Select
Selection.EntireRow.Hidden = True
End If
Next

End Sub
PatMc 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 09:10 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