9tanstaafl9
Well-known Member
- Joined
- Mar 23, 2008
- Messages
- 535
Sorry if this is obvious, but I have no idea how to even look it up. I've never done anything similar.
I have timecard values on one sheet that look something like this:
employee # 1 1 2 2
type ST OT ST OT
costcode hours
100 0 0 6 2
200 0 0 0 0
300 5 0 0 1
On another sheet, I need to have a result that looks something like this:
employee# type costcode hours
1 ST 100 0
1 DT 100 0
1 ST 200 0
1 DT 200 0
1 ST 300 5
1 DT 300 0
2 ST 100 6
2 DT 100 2
2 ST 200 0
2 DT 200 0
2 ST 300 0
2 DT 300 1
Is there any way with either formulas or VBA to get this information?
I was thinking of maybe just counting the number of employees, multiplying that by three and then by the number of cost codes. I could then automatically fill in the first three columns with no trouble. But the HOURS column I'd need some way to find the intersection of the cost code and the employee number. Then I could use an IF to figure out the different time types.
I can create named ranges if needed. I will not know the employee numbers or the cost codes ahead of time. Each employee has the same two time types, ST and DT. Some employees will have no hours and some cost codes will have no hours for any employee.
Any ideas would be appreciated, I have no ideas here.
I have timecard values on one sheet that look something like this:
employee # 1 1 2 2
type ST OT ST OT
costcode hours
100 0 0 6 2
200 0 0 0 0
300 5 0 0 1
On another sheet, I need to have a result that looks something like this:
employee# type costcode hours
1 ST 100 0
1 DT 100 0
1 ST 200 0
1 DT 200 0
1 ST 300 5
1 DT 300 0
2 ST 100 6
2 DT 100 2
2 ST 200 0
2 DT 200 0
2 ST 300 0
2 DT 300 1
Is there any way with either formulas or VBA to get this information?
I was thinking of maybe just counting the number of employees, multiplying that by three and then by the number of cost codes. I could then automatically fill in the first three columns with no trouble. But the HOURS column I'd need some way to find the intersection of the cost code and the employee number. Then I could use an IF to figure out the different time types.
I can create named ranges if needed. I will not know the employee numbers or the cost codes ahead of time. Each employee has the same two time types, ST and DT. Some employees will have no hours and some cost codes will have no hours for any employee.
Any ideas would be appreciated, I have no ideas here.