from post #37
add this at the end of the existing code
as part of the previously existing code is no longer there targrange is now invalid
I need to update next sheet also.
so it appeared you still needed all the previous code

also you need dim on line 4