144725
New Member
- Joined
- Feb 4, 2009
- Messages
- 5
My workbook has two sheets. Status and worklog sheets. I am trying to get the count of completed work of various phases in the status sheet which reads the data from worklog. Each phase is tracked in a column in worklog sheet. My Worklog look like this,
Col A: Workstream (Values 0-8)
Col B: Iteration (Values 0 -10)
Col H: Analysis (Values Complete, WIP, Yet To Start)
Col I: Clarification (Values Complete, WIP, Yet To Start)
Col J: Design (Values Complete, WIP, Yet To Start) etc.,
In Status sheet, I need the count of Iterations for which the above said phases are completed. So i wrote a function
Function Status(byVal Workstream as Integer, byVal Iteration as Integer, byVal phase as String) Ex: Status(1,5,"Design")
The function should autofilter the worklog with workstream, iteration and phase and return the no. of rows. The column to autofilter for phase is determined by a switch method.
But the ultimate result is, my function doesn't autofilter
Interestingly, when I replaced the function with a Sub and passed the count in a Msgbox, it worked. So the problem I have is, the same code for autofilter which worked for Sub doesn't work for function. Any thoughts
Col A: Workstream (Values 0-8)
Col B: Iteration (Values 0 -10)
Col H: Analysis (Values Complete, WIP, Yet To Start)
Col I: Clarification (Values Complete, WIP, Yet To Start)
Col J: Design (Values Complete, WIP, Yet To Start) etc.,
In Status sheet, I need the count of Iterations for which the above said phases are completed. So i wrote a function
Function Status(byVal Workstream as Integer, byVal Iteration as Integer, byVal phase as String) Ex: Status(1,5,"Design")
The function should autofilter the worklog with workstream, iteration and phase and return the no. of rows. The column to autofilter for phase is determined by a switch method.
But the ultimate result is, my function doesn't autofilter
Interestingly, when I replaced the function with a Sub and passed the count in a Msgbox, it worked. So the problem I have is, the same code for autofilter which worked for Sub doesn't work for function. Any thoughts