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 5th, 2002, 03:34 AM   #1
CAPT.PT
New Member
 
Join Date: Mar 2002
Posts: 32
Default

I am working on a Fire Dept. payroll...I have serveral worksheets and have to have a written statement(formulas) as to how I arrived at a certain figure. Dah--they don't trust computers at city hall!
Therefore I have to have a column for "how did you arrive at this figure"
so, I need a statement to appear in a cell the might end up saying:
11.2*23.50*4
that seems easy, but if the man didn't get any overtime then there is nothing in the cell. If he did, the total overtime figure is already calculated from another worksheet and put in lets say cell S6. so I need to have something like:
If S6>0,then,11.2*23.50*whatever figure is in cell P6.
cell P6 is the number of days he got overtime
and ofcourse will constanly be differant.
Any suggestions?

[ This Message was edited by: CAPT.PT on 2002-03-05 02:40 ]
CAPT.PT is offline   Reply With Quote
Old Mar 5th, 2002, 03:58 AM   #2
Ian Mac
MrExcel MVP
 
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
Default

I'd suggest not doing it like you ask for.

I'd right a seperate procedure/policy for this out lining what the formulas do, using generic formulas i.e.
Section 21: that + that + that if not that, is the hours worked if such and such.

I'd use word (I do use word!) for thsi kind of thing.

any company should accept this as it would need to be fully version controlled and therefore comply with ISO 9000:2000.

If your people don't accept a worldwide Quality system then...........

If you need any pointers E-mail me, I do this sort of thing for a living.
__________________
"Have a good time......all the time"
Ian Mac
Ian Mac is offline   Reply With Quote
Old Mar 5th, 2002, 04:06 AM   #3
Mudface
MrExcel MVP
 
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
Default

This might not be exactly what you're asking for, but if your data is on the same sheet, then clicking into a result cell, then selecting Tools-Auditing-Show Precedents, will show the cells that went into making your result. You could make a macro to run from a command button on the sheet and do this with one click e.g.

Private Sub CommandButton1_Click()

Selection.ShowPrecedents

End Sub

Hope that helps.
Mudface is offline   Reply With Quote
Old Mar 5th, 2002, 12:41 PM   #4
CAPT.PT
New Member
 
Join Date: Mar 2002
Posts: 32
Default

LOGICAL DAVE WHERE ARE YOU?
Guys, I know, you what your talking about...I don't....I have to keep things simple...I have a formula that writes most of what I want it to say, I only have to know how to print....what, lets say q4..which is the number of times a man worked cell says....I don't even need it to do the math...just write the number thats in that cell. So that it will print in a certain cell....11.2*23.50*4 4 is the number I need to print( of course it could be any number up to 24).
I am sorry...when you BRAINS say, all you have to do is What* this*that=whatever....has no effect....I need it like 10hr.s overtime*hr. rate*days worked = the total!
10*23.50*4=940 then I can understand!
I know, Dah, what is he doing here...I run into burning buildings..when you guys are running out....PLEASE, JUST MAKE IT SIMPLE!
I THANK YOU VERY MUCH! CAPT. PT
CAPT.PT is offline   Reply With Quote
Old Mar 5th, 2002, 01:02 PM   #5
Paul B
Board Regular
 
Join Date: Feb 2002
Location: Georgia USA
Posts: 544
Default

This will list formulas , cell address, and valves in a new worksheet, send a copy with your report and "they" can see the formulas and valves.
I think I got it off this board but don’t know who to give the credit to.

Sub ListFormulas()

Dim FormulaCells As Range, Cell As Range
Dim FormulaSheet As Worksheet
Dim Row As Integer

' Create a Range object for all formula cells
On Error Resume Next
Set FormulaCells = Range("A1").SpecialCells(xlFormulas, 23)

' Exit if no formulas are found
If FormulaCells Is Nothing Then
MsgBox "No Formulas or the sheet is protected."
Exit Sub
End If

' Add a new worksheet
Application.ScreenUpdating = False
Set FormulaSheet = ActiveWorkbook.Worksheets.Add
FormulaSheet.Name = "Formulas in " & FormulaCells.Parent.Name

' Set up the column headings
With FormulaSheet
Range("A1") = "Address"
Range("B1") = "Formula"
Range("C1") = "Value"
Range("A1:C1").Font.Bold = True
End With

' Process each formula
Row = 2
For Each Cell In FormulaCells
Application.StatusBar = Format((Row - 1) / FormulaCells.Count, "0%")
With FormulaSheet
Cells(Row, 1) = Cell.Address _
(RowAbsolute:=False, ColumnAbsolute:=False)
Cells(Row, 2) = " " & Cell.Formula
Cells(Row, 3) = Cell.Value
Row = Row + 1
End With
Next Cell
' Adjust column widths
FormulaSheet.Columns("A:C").AutoFit
Application.StatusBar = False
End Sub
Paul B 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 04: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