Question: I have problems with Laravel query.
So I have a table that have 4 properties that I need to check, and table looks like:

```
product_id | partner_id | employer_id | type

```

So `partner_id` is setted in `Config` and there can be multiple different partners, as well as products and employers, `type` can be `white` or `black`. Employers are array so I need to check them with `whereIn` or `whereNotIn`.

So what I need to check is, where `type` is `white`, and not current partner and not current employers to list all rows from that table.

So I did something like

```
ProductListing::whereNotIn('employer_id', $employers)
->where('type', 'white')
->where('partner_id', '!=', $partner_id)
->pluck('product_id')
->toArray(); 

```

But this query is not working as expected. I should probably check every row for `partner` and then list `whereNotIn`, but I have no idea how. Any ideas how to fix it?

Answer: 
I would recommend to use the FIND() function as described [here](https://www.thespreadsheetguru.com/blog/2014/7/7/5-different-ways-to-find-the-last-row-or-last-column-using-vba)

Moreover, you seem to be actively targeting column 10 to put your sum below the last value. The column count could change in the future. To make it more robust, you could either check the column names or always put the sum below the last column of your range. I´d also suggest to use subtotal instead of the SUM function 109, again, just to make it more robust.
You just need to loop through all your worksheets

```
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets  ' loop through all worksheets
    ' find the last used row in column A in each worksheet
    Dim LastRow As Long
    LastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row

    ' one below last row write the sum formulas
    ws.Cells(LastRow + 1, "A").Formula = "=SUM(A2:A" & LastRow & ")"
    ws.Cells(LastRow + 1, "B").Formula = "=SUM(B2:B" & LastRow & ")"
Next ws

```