My query is based on this deleted question (screenshot).
a)
As per Why and how are some questions deleted?,
Questions that are extremely off topic, or of very low quality, may be removed at the discretion of the community and moderators.
Moderators can delete any question however I am looking for a reason why that question was deleted. Its obvious that it came to my notice because I have an accepted and up-voted answer and deletion of the question led to deletion of my answer(loss of reps is not a concern) as well.
As far as I can understand, the question was deleted because it was already closed and down voted. The question is not of good quality and does not not show any efforts taken by OP to solve the issue but its still clear what the requirement of the OP is.
Also, the question was asked and answered on 17-May-2017 and was deleted yesterday i.e. 22-Oct-2017. So is there a time span for answer to be deleted or can question be deleted after any number of days from the date of asked or answered. (Although, as of now I guess, knowing this is not necessary for me)
Well, there's another question that was deleted after my answer was accepted. (screenshot)
b)
I also agree with this answer, stating
Give me the code is not a close reason according to SO rules but a downvote one.
Questions like "How to do something" or "Give me the code" could be down voted but should not be flagged as too broad and should be left to the other people whether they are interested in answering the question or not.
I am active on Excel related tags like [excel], [excel-formula], [excel-VBA], [VBA]. I've also observed that the questions with no efforts from OP tagged as [VBA] (this requires coding) are more likely to get flagged as "too broad" as compared to questions with no efforts tagged as [excel-formula] (this requires one liner formula). That means questions asking for formula are answered while questions asking for code are flagged. (I don't want to mention questions here but this has been the trend). So is it because people are ready to spend sometime answering one liner formulas but not the complete code and hence questions are flagged. Question I am referring here clearly shows what OP has and the desired output.
Feature Request
Finally, I would like to suggest that any question that has an accepted answer should not be deleted for one simple reason that the the problem of OP is solved and can be helpful to others.