You mean like this?
=RIGHT(N2,LEN(N2)-FIND("-",N2))+1&"-"&SUBTOTAL(9,$M$2:M3)
Set ref = ThisWorkbook.Sheets("2013")
what error are you getting, run time? what number what does it say
what version of excel are you using
maybe
set ref = ActiveWorkbook.Sheets("2013")
Glad to help. Thanks for the feedback
Glad to help. Thanks for the feedback
Dear friend,
Apparently there is another small problem. When I insert a new row in my table, the new row takes automatically the following formula: =1&"-"&SUM($M$2:M18), instead of =RIGHT(N16;LEN(N16)-FIND("-";N16))+1&"-"&SUBTOTAL(9;$M$2:M17), which, of course, gives a mis result. Any idea how to fix this?
Thanks!
Also, when I delete a row, the cells's formula below the deleted row changes automatically into =RIGHT(#REF!;LEN(#REF!)-FIND("-";#REF!))+1&"-"&SUBTOTAL(9;$M$2:M18), which gives as well a faulty result like #REF!.
Sorry for bothering so much!
When you insert a row, the formula below will still reference the cell above the inserted line which will cause issues if you put data in the inserted row. I don't have a total fix for it but what I would do to ensure your data is correct is once you have made all your changes, I would take off your filter and copy the formula that's in the first cell which I assume is in N3 and copy it over your entire range. Hope this sorts you out
Colin