I tend to answer mainly in VBA and every now and then people have an error which highlights that they haven't learnt some of the useful basics/ good practices yet.
As well as providing working code and explaining the changes I made, I also mention some best practices that might help them/ others avoid future errors.
This morning I noticed a comment on one of my posts saying that this type of answer belongs on Code Review than SO.
As far as I'm concerned, any helpful answer that is useful in any way has a place on SO. I certainly would have benefitted from coming across an answer like that when I was starting out.
I can appreciate that you typically see this kind of thing more on Code Review, but is there a reason you shouldn't be doing this on SO? Especially because OPs error clearly shows that they are lacking the basics.
The comment/answer in question is here: https://stackoverflow.com/a/43946661/2859347
Update
As per Martijn's answer below, my original answer was deleted. The post has since been edited (see this comment) so for full context see the revision history (revision 3).
.Value
avoids OP's error when pasting. Also the code provides a different and complete solution. I can't see who deleted my answer, but it's been voted as useful twice and also OP commented suggesting they possibly found it useful. I hardly think it was necessary to delete it. Even the original commenter (who does understand VBA very well) notes that some of the answer does address the question!Select
a cell in a worksheet that isn't active) is only mentioned once - as a comment to the question. Both answers fail to mention that as the cause, but probably could have done so - and then that would have led into mentioning that that is one of the reasons why we keep telling people that usingSelect
andActivate
are bad practice.