in the following loop u can see different if, elseif statements that are neccessary to filter on the excel worksheet
for some reason the elseif statement is not working and i don't know excatly why Is it due to wrong syntax, semantic or something else?
Hope someone can help me out find the problem or can come up with a workaround solution
For counter_MA = 7 To 20
For counter_ReportTasks = 3 To Report_LastRow
If CapacityPlaning_WS.Cells(counter_MA, 2).Value = Report_WS.Cells(counter_ReportTasks, 2).Value And Report_WS.Cells(counter_ReportTasks, 3).Value = "Development A" Then _
value_DevA = value_DevA + Report_WS.Cells(counter_ReportTasks, 4).Value
ElseIf CapacityPlaning_WS.Cells(counter_MA, 2).Value = Report_WS.Cells(counter_ReportTasks, 2).Value And Report_WS.Cells(counter_ReportTasks, 3).Value = "Development T" Then
value_DevT = value_DevT + Report_WS.Cells(counter_ReportTasks, 4).Value
ElseIf CapacityPlaning_WS.Cells(counter_MA, 2).Value = Report_WS.Cells(counter_ReportTasks, 2).Value And Report_WS.Cells(counter_ReportTasks, 3).Value = "AMS" Then
value_AMS = value_AMS + Report_WS.Cells(counter_ReportTasks, 4).Value
End If
Next counter_ReportTasks
CapacityPlaning_WS.Cells(counter_MA, 4).Value = value_DevA
CapacityPlaning_WS.Cells(counter_MA, 5).Value = value_DevT
CapacityPlaning_WS.Cells(counter_MA, 6).Value = value_AMS
Set value_DevA = 0
Set value_DevT = 0
Set value_AMS = 0
Next counter_MA