1

I had a question that was removed for being off-topic regarding how to remove the ActiveWindow.ScrollColumn lines from my recorded macros.

The reasoning behind the close was that my "question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers."

But most of what I do with Excel VBA is UX design, something I feel that should fall under the criteria for the site. The problem was solved using Regex on Notepad++ from another user, which is a solution that I feel would apply to a lot of programming problems.

Am I missing something?

The question: I have hundreds of ActiveWindow.ScrollColumn lines from my recorded macro, how do I get rid of them easily?

21
  • 14
    That question isn't about excel VBA though, it's about how to use find and replace: "I thought about using the Find & Replace ... Is there a way to make it replace every line by accounting for the 1-60 at the end" Commented Oct 5, 2022 at 15:38
  • 8
    @NickstandswithUkraine On the other hand, it's limited to the tools that developers would use in that programming language (Find & Replace in VBA), and was solved using Regex on Notepad++. It seemed like a question best answered by programmers, and it was. It feels kinda pedantic that it was flagged as an inappropriate question considering it's a feature used and solved by programmers. Commented Oct 5, 2022 at 15:45
  • 2
    @NickstandswithUkraine Put another way, I think my question helps other programmers searching for a solution for their code, and I think that's evidence of its validity on our site. Commented Oct 5, 2022 at 15:52
  • 1
    The VBA and Excel are irrelevant to the question though, it is just how to mass find and replace text based on some rule. That is not a programming question.
    – Warcupine
    Commented Oct 5, 2022 at 15:58
  • 4
    @Warcupine but at the same time, using a combination of Notepad++ with Regex feels like a solution only a programmer or a super user would be able to provide, and it was the only solution I received that did what I needed it to. I think it is a programming question, even if it doesn't necessarily look like one at face value. For context, who would learn more from this than programmers? Commented Oct 5, 2022 at 16:04
  • 1
    @Warcupine Would you close this too? stackoverflow.com/questions/6116978/…
    – TheMaster
    Commented Oct 5, 2022 at 16:16
  • 2
    @Makoto I was responding to Warcupine: The VBA and Excel are irrelevant to the question though, it is just how to mass find and replace text based on some rule.. I could say the same The python tag is irrelevant to the question though, it is just how to mass find and replace text based on some rule.. Can't I?
    – TheMaster
    Commented Oct 5, 2022 at 16:18
  • 1
    @TheMaster: ...no, you can't. You literally can't. Replacing text in languages is different depending on the language, especially based on the syntax and what is returned (you don't know if a language chooses to modify the string in-place or if it returns a new immutable copy).
    – Makoto
    Commented Oct 5, 2022 at 16:20
  • 3
    @Makoto Again, I could say the same: Replacing text in languages is different depending on the language, especially based on the syntax and what is returned. VBA tag is relevant and the syntax is relevant. Not just any find-replace will do. There's a syntax and the replace should only replace the correct words in the correct place.
    – TheMaster
    Commented Oct 5, 2022 at 16:23
  • 3
    @TheMaster: I seem to have a challenge on getting to see your perspective on this. Perhaps it'd be best if you put together an answer on this question to explain your perspective on why this question didn't deserve to be closed.
    – Makoto
    Commented Oct 5, 2022 at 16:25
  • 2
    @TheMaster probably, yeah I really don't see the need to have a how-to guide for search and replace in every single IDE. They all work basically the same and aren't specific to IDEs. Word also has built in search and replace and in theory I could copy my stuff to a word doc and replace my python with that and copy it back in, that doesn't make word search and replace a programming topic.
    – Warcupine
    Commented Oct 5, 2022 at 17:18
  • 2
    @TheMaster Just did, worked fine. 90 people in 12.5 years isn't a ton... My office workers can find and replace and they can't write a vlookup so I'm going with not primarily used by programmers.
    – Warcupine
    Commented Oct 5, 2022 at 17:27
  • 3
    @Warcupine I'm surprised that it worked. Nevertheless, find and replace isn't the issue. not primarily used by programmers is about the Tool not find and replace. OP's VBA IDE is the tool. That is the tool that's primarily used by programmers. And that tool obviously isn't able to "completely" do what OP wanted. "Copy paste to another IDE, find and replace" was one of the solutions. If you don't like the solution, downvote it! But the question, because it's about a feature of the inbuilt ide, is on topic.
    – TheMaster
    Commented Oct 5, 2022 at 17:32
  • 3
    @Warcupine Yes, it does have pattern matching. OP does mention that in his answer, but it still isn't able to do what he wants with ease.
    – TheMaster
    Commented Oct 5, 2022 at 17:38
  • 2
    @Makoto Respect for withdrawing your answer, even when it had significant upvotes than mine.
    – TheMaster
    Commented Oct 11, 2022 at 8:39

2 Answers 2

5

I think the main problem with your question is the way it's presented. Given the tags, you presented it as an issue with VBA and Excel, but in reality it's not an issue with either of them. They're doing exactly what they're being told to do and exactly what you expect.

You mentioned in your question that you "thought about using the Find & Replace feature" but that you "have no idea" how to actually use it to solve your problem, so why wasn't your question more focused on this? If you're familiar with search and replace in IDEs, I would also assume you're at least semi-familiar with Regex (or at least know of it's existence), so why not ask about Regex specifically?

On the other hand, it can be dangerous to ask about an intended solution rather than the actual problem because it's very easy to fall victim to the XY problem. I can see how someone that isn't very familiar with Regex would want to avoid this by adding more context than is necessary in order to ensure the problem is clear. However, that doesn't change the fact that the question is unrelated to the tags provided, and is quite misleading because of that.

I don't necessarily agree that this question is off-topic, but it is definitely not a problem specific to VBA or Excel and should not be framed as such. That being said, I don't fault you for asking it the way you did. This is a very tricky situation.

5
  • 5
    VBA/Excel has a inbuilt ide. That's the only ide OP was working with. So, the tags [vba]+[excel] are absolutely relevant and essential. Apparently, that inbuilt IDE doesn't support regex, hence OP's unfamiliarity with the subject.
    – TheMaster
    Commented Oct 5, 2022 at 17:11
  • 1
    @TheMaster They may be relevant to the specific problem that the OP is facing, but they are not relevant to the presented question at all. There's a huge difference between a question that is about a topic, and a question that just happens to be related to a topic. This question is about searching and replacing a pattern in text, where the text just happens to be VBA written in Excel.
    – Jesse
    Commented Oct 5, 2022 at 17:17
  • 2
    searching and replacing a pattern in text, where the text just happens to be VBA written in Excel. No... It's about searching and replacing a pattern in the inbuilt excel's VBA IDE and the text also happens to be VBA written in Excel. Shouldn't a ide question include the IDE tag?
    – TheMaster
    Commented Oct 5, 2022 at 17:26
  • @TheMaster Not necessarily, but I see where you're coming from. I mainly contribute to C# questions which in most cases are written in Visual Studio. The visual-studio tag explicitly says to not use the tag in "questions regarding code which merely happened to be written in Visual Studio". I generally agree with this approach because unless it's a problem with the IDE itself, that information isn't needed to provide an adequate answer, and can sometimes even hurt the question. This specific question is about the text itself, not the specific IDE or anything specific to VBA.
    – Jesse
    Commented Oct 5, 2022 at 17:37
  • 3
    It is specific to the inbuilt VBA IDE. It seemed to be impossible in inbuilt IDE, therefore one answer suggested a third party IDE. But nevertheless, the question didn't ask for a third party IDE anywhere. This is about the inbuilt features of excel's VBA IDE.
    – TheMaster
    Commented Oct 5, 2022 at 17:40
1

This is on-topic. Not just on-topic, but a useful question too.

As the /help/ontopic page says, questions about

software tools commonly used by programmers;

are on-topic.

It's important to note that, unlike other programming languages, VBA has a inbuilt default and OP is asking for a way to remove certain code in that IDE without creating syntax errors. This is a perfectly on-topic question. A answer recommended a third party IDE, because it was not possible(easily) with inbuilt IDE. But OP's own answer shows how to do this with the inbuilt IDE. The is appropriate here, because there is no tag. There was no need for such a tag, because all [vba] experts are [vba-ide] experts as well. As a SME in Google apps script, (Google's equivalent of excel's VBA, but much more modern), We even had a [ide] tag for our inbuilt editor called tag, but after much deliberation, decided that it was not necessary and decided to merge it to the parent tag. I'm saying this because the tag doesn't just encompass the language, but questions associated with the default too.

As to why it's useful, the automatic macro creator is known to commonly add useless lines like these in the IDE. Any post providing a useful way to remove these is helpful.

I really don't see how this is different from any other or string replace questions like this. If you're still not convinced, here are some sample well received questions from other s.

Sample + replace questions:

There's no difference between the above and this question about the inbuilt 's .

Some meta posts showing consensus on the matter:(from zcoop)

21
  • 5
    This is spot on; there's a pretty large history of posts agreeing with this interpretation of the help center. IDE questions that are "practical, answerable problem[s] that [are] unique to software development" are unequivocally on topic here, and are very helpful to future visitors of the site. Using an IDE to edit code clearly fits IMO.
    – zcoop98
    Commented Oct 5, 2022 at 23:02
  • 4
    @zcoop98 I thought so too. But I'm baffled that the community isn't unanimously agreeing with me. Maybe they don't understand the concept of inbuilt ide? I don't know.
    – TheMaster
    Commented Oct 5, 2022 at 23:05
  • 1
    @TheMaster Honestly, it feels like there's a weirdly exclusive culture in this Stack Exchange site. It almost seems like people vote mostly based on what's relevant or clever to each person, rather than the quality of the question or answer. I really appreciate your references and support on this. My first post got shut down, but you worked hard to make sure I felt heard and that left a bigger impression. Thanks, man. Commented Oct 6, 2022 at 17:23
  • 1
    @Man_Over_Game Glad to help. Regarding votes, that's how meta operates. But, They don't reduce your real reputation on the main site. So, people are free to cast their votes based on how they feel or which side of the bed they woke or what their favorite idol says". Meta does get things right and even tries to self correct. It has good and bad. Politics is bad, but the person on the top is usually the one doing all the dirty work regularly and spends valuable time, so it's only right they get some special treatment[1/2]
    – TheMaster
    Commented Oct 6, 2022 at 17:57
  • On the other hand, it drowns out differing opinions, and it's too proud to ever admit they made a mistake. So meta severely lacks Subject matter experts to judge right from wrong [2/2]
    – TheMaster
    Commented Oct 6, 2022 at 17:58
  • @zcoop98 If you believe this is ontopic question, Is there a reason not to cast a reopen vote?
    – TheMaster
    Commented Oct 6, 2022 at 18:12
  • Downvotes, which are indications of opinion here on meta, drown out opinions?
    – Kevin B
    Commented Oct 6, 2022 at 18:18
  • 1
    @KevinB I was referring more to the votes on the main site. I just counted the first 10 questions on the "active" filter for the primary site, they average to about 1 answer and -1/3 votes each. Seems almost like there's a negative bias on the site. Commented Oct 6, 2022 at 18:21
  • voting, overall, is much closer to 85% upvote 15% downvote. useful content gets upvotes, not useful content doesn't. Some posts get downvotes, though not enough of them.
    – Kevin B
    Commented Oct 6, 2022 at 18:24
  • @KevinB I guess that's the part that seems strange to me. Most SE sites vote based on quality, not relevancy to the voter. Every question is useful to the person asking it (and anyone looking it up) so it feels wrong to downvote something that's irrelevant to the voter. I suspect it has to do with how specialized this site is compared to others; it takes a lot more effort to understand someone's question than it does with other sites. Commented Oct 6, 2022 at 18:27
  • To be fair, i generally agree that your question, referenced in the question here, isn't off topic, though be careful not to just assume that because it's about an IDE used for programming that it is defacto on topic, simply being topical doesn't make a post immune to closure (nor does it mean it can't be seen as not useful or poorly researched by peers)
    – Kevin B
    Commented Oct 6, 2022 at 18:28
  • 1
    @KevinB From my experience, most questions get downvoted on other SE sites because of their overall lack of quality. EG it's unclear, has a lack of links or information, or it's simply solved via Google, it's irrelevant to the site, etc. It's what separates us from a social media site like Reddit, where votes indicate relevancy or opinions. (Meta sites being an exception) Commented Oct 6, 2022 at 18:37
  • 1
    @TheMaster Because I lack about 600 reputation to VTC/ VTO posts, unfortunately.
    – zcoop98
    Commented Oct 6, 2022 at 18:40
  • 1
    @KevinB In hindsight, though, it does kinda make sense that a site ran by programmers is zealous about following rules. Commented Oct 6, 2022 at 21:54
  • 1
    Programmers do like their neat little buckets
    – Kevin B
    Commented Oct 6, 2022 at 21:55

You must log in to answer this question.

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