1

My question was Randomly select data from multiple sheets in Excel .

Within a few minutes of posting the question, it was closed for being not focused.

I being totally new to programming, and with a background of political science, could add a few lines to the codes already linked in my post and made it workable, though not in any way perfect.

I repeat, I just added a few lines to the already existing answers of similar question already answered and of which I had given links.

For expert professionals it would have been like breeze.

Most of my questions are of this nature only. I acquainted myself with the forum and only when I found there were plenty of questions like this but not exactly the same, duly upvoted and answered, did I posted mine.

It would be great if anyone could please anyone advice on what went wrong and how I could have been more focused.What I want to know is was there any way the question could have been split?

The whole question was:-

How can I select randomly any number of sample (say 10) where data can be extracted from any sheets with the condition that there is letter Y in the corresponding row in column "H".

In other words, I need to refer to random rows from random sheets with the given criteria and get the result of the values in a separate sheet.

6
  • 15
    "I need to refer to random rows from random sheets with the given criteria and get the result of the values in a separate sheet." - Okay, and you have some code in your question as well, what does the code do? How does the code not solve your problem? What are you missing? Have you made an attempt to fix it yourself? If no, how come? If yes, what went wrong? - In other words, what's the actual problem you're having? Commented Feb 12, 2020 at 11:26
  • 4
    Your question is pretty long with screenshots, a lot of code and a lot of text. If your only actual question was "how to select a random sample", you should really focus your question on only that and explain what precisely your issue is with that. Currently it's somewhat vague how much of your problem we're really supposed to solve for you.
    – deceze Mod
    Commented Feb 12, 2020 at 11:27
  • 4
    @deceze FWIW what you see there now differs from original revision
    – gnat
    Commented Feb 12, 2020 at 11:45
  • 5
    @gnat Yes, but the revision which was closed was also somewhat unfocused. It should be simply here's an example sheet, here's what I need, here's some attempt and/or what I'm stumped on exactly.
    – deceze Mod
    Commented Feb 12, 2020 at 11:48
  • 3
    Your current question is a lot better already, but I'm not competent enough with Excel to decide on whether to cast a reopen vote. Probably still think about whether you could do something to reduce it to a Minimal Reproducible Example.
    – tripleee
    Commented Feb 12, 2020 at 13:03
  • 8
    Within a few minutes of posting the question it was closed actually 1 hour 19 minutes. If you are going to complain about a closure, at least be honest about the back story Commented Feb 12, 2020 at 20:33

1 Answer 1

20

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

1
  • 11
    That same approach worked for the 3 other (visible) questions – they got answered. So the OP was actively guided to do so. Only once it was asked to post the data as copyable text (and it got ignored by the OP). We need more close votes – just to show this is not the way to ask a question.
    – Jongware
    Commented Feb 12, 2020 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .