We have an Excel sheet that is a database of tasks used to manage work assignments for about 10 people in the office. As it is today, a staff member can click on a control on the sheet with their name and the list will filter out blank records, displaying to them just their tasks that are not in any closed or completed status; basically, just the tasks they still have to work on. I have the following code, which works just fine:
However, we introduced a new column: "Reassigned To" which are tasks originally assigned to one staff member but were delegated to someone else. These now need to be included in an employee's search of their own specifically assigned tasks. I am trying to incorporate an OR statement in the filtered record results, but am having no luck. Can someone help adjust the code? I feel I am missing something simple here:
VBA Code:
Sub TASKS_Owner_Frances()
'
' Display tasks for Frances
'
ActiveSheet.Range("$A$6:$BU$1010").AutoFilter Field:=13, Criteria1:="<>" 'this is in here just to avoid an error when toggling from one user to the next...it otherwise serves no purpose
ActiveSheet.ShowAllData 'remove any pre-applied filters
ActiveSheet.Range("$A$6:$CA$1010").AutoFilter Field:=25, Criteria1:=Array( _
"Not Started", "On Hold", "Paused", "Started"), Operator:=xlFilterValues 'display only active tasks
ActiveSheet.Range("$A$6:$BU$1010").AutoFilter Field:=17, Criteria1:= _
"Frances" 'tasks originally assigned to Frances
ActiveSheet.Range("$A$6:$BU$1010").AutoFilter Field:=21, Criteria1:="=" 'task has not been reassigned
End Sub
However, we introduced a new column: "Reassigned To" which are tasks originally assigned to one staff member but were delegated to someone else. These now need to be included in an employee's search of their own specifically assigned tasks. I am trying to incorporate an OR statement in the filtered record results, but am having no luck. Can someone help adjust the code? I feel I am missing something simple here:
VBA Code:
Sub TASKS_Owner_FrancesTest()
'
' Display tasks and reassigned tasks for Frances
'
ActiveSheet.Range("$A$6:$BU$1010").AutoFilter Field:=13, Criteria1:="<>"
ActiveSheet.ShowAllData
ActiveSheet.Range("$A$6:$CA$1010").AutoFilter Field:=25, Criteria1:=Array( _
"Not Started", "On Hold", "Paused", "Started"), Operator:=xlFilterValues
With ActiveSheet.Range("$A$6:$BU$1010")
.AutoFilter Field:=21, Criteria1:="Frances", Operator:=xlOr 'reassigned field
.AutoFilter Field:=17, Criteria2:="Frances", Operator:=xlOr 'assigned to field
.AutoFilter Field:=21, Criteria2:="=" 'reassigned field...we want it to be blank in this instance, otherwise it wouldn't belong to Frances
End With
End Sub