Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Trisha
i might be missing the point here, but if you added up the total hours for the employee and then deducted the total of B*, C*, L* won't you get the answer you want? Cheers JulieD "Trisha B." wrote in message ... We have a series of reports generated by an Access 2000 database in our Payroll department which are sent to our Financial Services department. The report consists of several columns (only three of which concern me) and 10,000+ rows. The columns a Column A the employee ID, Column B the pay code, and Column C the number of hours worked at that pay code (there are no column headings on the report). The rows contain every payroll code for every employee for a given two-week pay period, and the number of hours worked at that code (e.g., "A" is regular day shift, "AE" is regular evening shift, "BE" is time and a half evening shift, and it goes on). The problem discovered yesterday is that overtime hours are being reported twice, once as code AE and again as code BE. This also occurs with code CE (double time evening shift) as well as with K's (Inservice Days) and L's (Inservice Overtime days). The original developer of the database is not available and, for reasons I won't go into here, the preference is that I adjust the report, not the database. Hence my request for your help. A very small representation of the worksheet would be very similar to this (forgive the spacing, I know it never posts as written): A B C 1 1122 AE 8.00 2 1122 AE 1.00 3 1122 BE 1.00 4 1122 JD 8.00 5 1234 AE 8.00 6 1234 CE 8.00 7 1234 AF 24.00 8 1234 SL 8.00 9 1234 SLE 8.00 What has been requested of me is: 1. To write code that will loop through each employee's recordset for the given pay period, 2. Find any instances where the value of Column B = any B* (* indicating a wildcard) or C*and, if found, 3. Also find the corresponding A* value whose hours worked (Column C) is equal to the hours worked for the B* or C* value and convert the hours that relate to the matching A* to 0.00 then 4. Repeat the process if there is a K and L (K becomes the A, L the B*, C*). In the example above, in row 3, column B has a value of BE so they want me to automate finding an A* pay code in the first four lines (as define the employee ID) and also find the matching value in column C (so it would be line 2, column B) and convert line 2 column C from 1.00 to 0.00. After it does that, it would then go on to the next employee and repeat the process. Employees have different numbers of rows, some as few as three, others in excess of 10, for each pay period with no breaks between rows. We have approximately 10 old worksheets for this to be applied to and all future worksheets will need the VBA code run against them. Any assistance with this would be greatly appreciated. Many thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Replace Chart Values with Second Set of Values | Charts and Charting in Excel | |||
array functions and complex element values | Excel Worksheet Functions | |||
averaging values according to (very) complex conditions | Excel Programming | |||
??Find and Replace Duplicate Cells | Excel Programming | |||
Complex identify values then cut/copy/paste query | Excel Programming |