Skip to main content
16 events
when toggle format what by license comment
Apr 4, 2016 at 12:53 comment added Kaz You could, but then you're accessing the worksheet every time you set a new range, and accessing a worksheet is slow. Do it once (to put it in an array) and you'll never notice, do it 10,000 times and your sub will slow to a crawl. w/rt multiple outputs: I would consider having a table(array) where each country gets a column and for each row, check off if each country appears in said row.
Apr 4, 2016 at 12:10 comment added user1996971 Thanks, Kaz. This works perfectly now (although I have not implemented the third refactoring yet). I'm currently seeing what changes I could make to have multiple countries pulled out if they occur. I'm considering having a new output spreadsheet, and using the insert command to give me multiple results. Any suggestions you have would be very welcome. And finally, instead of putting my search range into an array, could I not just change the range to "all of row i" and have that increase in increments? Thanks,
Apr 1, 2016 at 16:15 comment added Kaz I've added an addendum on codenames.
Apr 1, 2016 at 16:15 history edited Kaz CC BY-SA 3.0
added 808 characters in body
Apr 1, 2016 at 16:11 comment added Kaz It's because it's expecting a codename (namely, wsCountryNames) to already exist.
Apr 1, 2016 at 16:11 comment added user1996971 Ok, I'm confused at the 2nd Refactoring. Running the updated code as is is giving me a Object required error for Set topLeftCell = .Cells(1, 1) Is this expected?
Apr 1, 2016 at 16:10 history edited Kaz CC BY-SA 3.0
added 4343 characters in body
Apr 1, 2016 at 16:05 vote accept user1996971
Apr 1, 2016 at 16:05 history edited Kaz CC BY-SA 3.0
added 4343 characters in body
Apr 1, 2016 at 15:43 history edited Kaz CC BY-SA 3.0
added 643 characters in body
Apr 1, 2016 at 15:07 history edited Kaz CC BY-SA 3.0
added 643 characters in body
Apr 1, 2016 at 15:04 history edited Kaz CC BY-SA 3.0
added 572 characters in body
Apr 1, 2016 at 14:58 comment added Kaz Don't go anywhere. This got posted halfway through me writing it so more is coming. The problem with : is that it literally says to the compiler "Treat everything after the : as though it were on a new line". You should just put it on a new line and prevent any confusion.
Apr 1, 2016 at 14:49 comment added user1996971 Awesome. This is great advice, given that I'm totally oblivious to naming conventions. What do you mean by "Don't Use :" Is there an issue with the line Else: i = i + 1?
Apr 1, 2016 at 14:47 history edited Kaz CC BY-SA 3.0
added 572 characters in body
Apr 1, 2016 at 14:41 history answered Kaz CC BY-SA 3.0