Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro needed for a If Then situation

Status
Not open for further replies.

alisapooh

Technical User
Sep 8, 2009
6
US
For background info, first post was in excel help forum:

I have a workbook with several worksheets in it. Each worksheet has the same format, just different accounts on each worksheet.

For example, say an employee was authorized to work 40 hours on job A (WORKSHEET: A) and worked 45; and authorized 32 hours on job B (WORKSHEET: B) and worked 30. There is a column on each worksheet to show the variance.

I am trying to create a summary sheet of all of the employees with negative variance hours. I don't need all of the lines (Job B +2), just the negative ones (Job A -5).

Is there some easy way to accomplish this without manually looking through each sheet?

Thanks

2nd post:

I think what I need is a macro - and I know NOTHING about how to create one other than following the instructions that say create macro.. Start ... stop... etc.

I've attached (I hope it works - it is in a google doc) a sample workbook with the different pages and what I am looking for.

It just needs something like if worksheet JobA cell J8<0, then copy it here; if J8>0 check K8, etc. So it will check about 7 cells on about 15 worksheets. I don't know how to do the keep checking thing so I don't have a bunch of blank entries.

I have created a pivot table that summarizes ALL of the data into a table (rows - job #, columns - category). I can pull from that too... just still don't have a list of what categories are negative.

Also - where can I go to learn this stuff? Will an advanced excel class teach this? My excel knowledge is pretty good, but not this good!


Thanks again for any help!!!

Alisa
 
Can you not get the hours and dollars into a single pivot table?
How does the info in the pivot table relate to that on the Job sheets? I can't see the relationship.
Working with the pivot, for the first few jobs is this what do you want to see?
Something like:
[tt]Job Category Hrs Variance Cost Variance
35020 AV (310.5) $0.00
35020 BQ (120.0) $0.00
35020 ODC $(268.98)
38001 BQ (48.0)
38001 ODC $(2,627.99)
(478.5) $(2,896.97)[/tt]



Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top