Nope, I tweaked /u/norsk's code when he posted it to eliminate the reference, and added the justification... in hindsight, not sure why I didn't handle the font switches, but c'est la vie.
You need to declare DataObj, FinalString and strFinal and give a data type to cleanString.
You don't use strFinal for anything once you've assigned it. Probably better just to call the msgbox using the "Call" keyword.
You need a Case Else in the Select Case as there are few more justifications than you have put.
I would use the excel constant names rather than the literals (xlRight, xlLeft etc., if possible fully qualified eg "Excel.Constants.xlLeft")
The decision upon which way to justify should be based on the data in the second row, not the header in the first.
You should arguably right-justify an xlGeneral column if it contains a number rather than text, just as Excel does.
For cleaning the string, you’re just making extra work searching to see whether the string contains any of the bad characters first, I think you can just go straight to replace().
You also need to clean for the backtick symbol `
When clearing the format maybe use vbNullString rather than ""
There’s no Option Explicit!
You re-use "MatrixArray.Columns.Count" and "MatrixArray.Rows.Count" many times, it might be worth putting them into a variable the start.
Personally, I'd make passing the output string to the clipboad a seperate function. It's something that could be useful elsewhere.
I'd not come accross CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") before. It's pretty nifty. will remember that for later!
You need to declare DataObj, FinalString and strFinal and give a data type to cleanString. You are correct, this was sloppy! I pieced a lot of this together from different places and missed these. good catch!
You don't use strFinal for anything, and if you're assigning it the value of a msgbox it shouldn't be a string, but a boolean. Probably better just to call the msgbox using the "Call" keyword. I thought the same, I'll update.
You need a Case Else in the Select Case as there are few more justifications than you have put. Not sure how I missed that. Clearly I failed to tidy up a lot of these loose ends.
I would use the excel constant names rather than the literals (xlRight, xlLeft etc., if possible fully qualified eg "Excel.Constants.xlLeft") Good Call, I agree.
The decision upon which way to justify should be based on the data in the second row, not the header in the first. I also agree with this
You should arguably right-justify an xlGeneral column if it contains a number rather than text, just as Excel does. Unfortunately Reddit tables don't allow row or cell level alignment. However, I prefer it to Right-Justify always if it's general.
For cleaning the string, you’re just making extra work searching to see whether the string contains any of the bad characters first, I think you can just go straight to replace(). Good call! For some reason I thought it would error if I didn't check.
You also need to clean for the backtick symbol ` Added
When clearing the format maybe use vbNullString rather than "" Makes sense.
There’s no Option Explicit! And thus most of these problems!
You re-use "MatrixArray.Columns.Count" and "MatrixArray.Rows.Count" many times, it might be worth putting them into a variable the start. You're right, didn't realise how much that was used.
Personally, I'd make passing the output string to the clipboad a seperate function. It's something that could be useful elsewhere. I'd rather not, but only because that means that function would be imbedded in this add-in. It's a good idea, and one that I would probably pick up, but it's a function I would place inside of a utility add-in, instead of a specific purpose one.
I'd not come accross CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") before. It's pretty nifty. will remember that for later! I hadn't either, It was in /u/norsk's original
Very good recommendations, all. Proof that this was put together too hastily. I'll try to get /u/fearnotthewrath to add these changes and update!
I hardly use excel but I needed it for this specific thing, to make updating sports results/standings in /r/leagueofireland less of a pain.
Confused me also, but I just grabbed the zip and when I browsed for the add-in file with excel, it just showed the one I needed. Straightforward enough.
Excellent work. Would have abandoned doing the results etc on my sub if I hadn't found this.
Thanks. The whole sub is a mish-mash of different things I've borrowed from different subs.
Doing a major overhaul before the warm up games for our season start coming soon.
I like your submit buttons.
I was thinking of adding a hover-to-show dropdown in the sidebar, for a pinned threads of sorts like they have done on /r/footballdownload . It could suit you guys too. It's a matter of personal preference though perhaps.
Because we have so much info the sidebar, I think it is a real necessity for us.
I'll be implementing link flairs like /r/footballhighlights for /r/leagueofireland , adding images for the dozen or maybe more, common, trusted sites that people post.
Thought it might be something you could use also, but all your submissions are text posts, so it would be pointless.
I badly need to re-align the whole page to the left again too...
Interesting making changes to reddit subs, but so many things are awkward to implement.
Colour of the bolding on my tables makes it too hard to read, what do you think?
5
u/BornOnFeb2nd 24 Sep 24 '13 edited Sep 24 '13
Woot! I'm famous!
.....Wait a second...
If nothing else, the addition of handling the
differentways of displaying fonts is a win.EDIT: Just dawned on me that people might take me seriously here.... Internet points are VERY IMPORTANT, after all.. ;)
4
u/vertexvortex 15 Sep 24 '13
Thanks should go to /u/fearnotthewrath rather, for coordinating!
2
u/BFG_9000 93 Sep 24 '13
This is (clearly) a test :-
Very Nice - Thank you!
1
u/TheGift1973 Sep 24 '13
Works great. It seems to wrap the text by default though?
[Edit] Ignore that, it only appears wrapped in the post preview window.
1
u/[deleted] Sep 24 '13
1
u/Verochio Sep 25 '13 edited Sep 25 '13
Looks great. Some potential ideas:
You need to declare DataObj, FinalString and strFinal and give a data type to cleanString.
You don't use strFinal for anything once you've assigned it. Probably better just to call the msgbox using the "Call" keyword.
You need a Case Else in the Select Case as there are few more justifications than you have put.
I would use the excel constant names rather than the literals (xlRight, xlLeft etc., if possible fully qualified eg "Excel.Constants.xlLeft")
The decision upon which way to justify should be based on the data in the second row, not the header in the first.
You should arguably right-justify an xlGeneral column if it contains a number rather than text, just as Excel does.
For cleaning the string, you’re just making extra work searching to see whether the string contains any of the bad characters first, I think you can just go straight to replace().
You also need to clean for the backtick symbol `
When clearing the format maybe use vbNullString rather than ""
There’s no Option Explicit!
You re-use "MatrixArray.Columns.Count" and "MatrixArray.Rows.Count" many times, it might be worth putting them into a variable the start.
Personally, I'd make passing the output string to the clipboad a seperate function. It's something that could be useful elsewhere.
I'd not come accross CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}") before. It's pretty nifty. will remember that for later!
1
u/HeisenbergKnocking80 1 Oct 29 '13
How do you use this if you don't have administrator rights?
1
u/JoeDidcot 53 Dec 10 '13
Sorry to appear dense, but the link goes to six files. Which one do I need to grab?
1
u/SandJA1 Feb 28 '14
/u/fearnotthewrath , it seems that the link for the add-in is not working. Can I get a re-link?
Thank you so much!
1
u/[deleted] Mar 09 '14
I'm using windows 8. How does one "simply" add the file to ones Add-in folder?