As one of the close voters I'll try and give an explanation.
I follow Q's in the [Excel] and [VBA] tags only, so my experience of SO is limited to these only, other Tags may or may not follow similar patterns.
We see a lot of requirements dump questions, where the asker simply states a desired outcome (often leaving out crucial details), with the implied Q of "can someone do this for me". At the time of closing your question gave that impression.
Lets paraphrase your Q:
- Here's an image of a small part of my data
- "I want to..."
- "Here's a similar post ..."
- "An idea I had was ..." with some off-site links, "... but I don't like that idea"
- "Please guide me..."
To break that down:
- Providing sample data is good, but providing only as an image is not helpful. If I were to answer, I'd want to get that data into a sheet. Retyping it is not appealing, when you could have simply pasted it as text in the Q.
- Reasonable but not complete description of your desired outcome: eg
- Which sheets contain data, and how to identify them? (you did say "from random sheets")
- What probability distribution do you want? eg uniform across the sheets (each sheet contributes equal number) or uniform across the whole data set. or something else
- What do you want to do with the results: You say ' in a separate sheet" but is that a new sheet, an existing sheet, in the same workbook, or a new/different workbook, is there existing data on that sheet, should it be cleared or appended, ...
- Your "somewhat similar" link: Ok, so how was it helpful, how was it not helpful, what does it do, and how is that different from what you want, what attempts did you make to modify it, how did those fail,...
- Your off-site links: same response to "somewhat similar" Q
- I don't know how many times I've answered with general guidance, only to be met with demands for a "complete" answer, so forgive me if I'm a bit cynical.
I don't have a problem with Q's without code, asking for an algorithmic solution (in fact those are often more interesting), but I expect a lot more from the asker before I'll engage.
You only later added some code, but then didn't explain what it does, what it doesn't do, does it throw errors, does it give the right/wrong result, etc
As it now stands, I'm still not inclined to vote to reopen