by Arrath · 4y ago · 0 comments
Now I'm imaging Clippy popping up when you copy a ludicrous amount of data to the clipboard. "You appear to be using a cludgy method, may I suggest something better?"
Of course, I'm guilty of things like this. I have one excel macro that splits data from a giant stream* (one monolithic CSV, actually) into discrete units, graphs them, and then sorts the graphs for printing. It makes a lot of use of the clipboard, and god help you if you try to copy/paste something while the macro is running.
*Giant enough that at one point it grew to where I overran my Int and had to upgrade some of the code to Longs :V
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Dim intRetval As Integer
' TODO maybe respect some of the properties on Assistant to let the user disable this
If InStr(Target.Formula, "VLOOKUP") = 0 Then
Exit Sub
End If
' TODO is one use really "excessive"?
Assistant.Visible = True
With Assistant.NewBalloon
' TODO I should probably do ".Mode = msoModeModeless" but I don't feel like writing a callback
.Text = "It looks like you're trying to implement a relational database in a spreadsheet."
.Labels(1).Text = "Get professional help"
.Labels(2).Text = "Just let me generate excessive technical debt without help"
.CheckBoxes(1).Text = "Don't show me this tip again"
.Button = msoButtonSetNone
.Animation = msoAnimationGetAttentionMinor
intRetval = .Show
' TODO make the user's choices actually do something
End With
End Sub
You'll need to load Office 97 or some other ancient version in a VM if you want to actually try this, since Microsoft finally killed off Clippit completely in Office 2007.When I worked for a company where corporate used it, the problem was that people would come to me for help. M is pretty easy to learn so it wasn't a big deal for me. But I am a software dev with database experience, so I'm not sure who the target market is here--it's not the pure Excel users. Like, they wanted tables from a shared folder appended on each other and joined to another table. In pure Power Query you can do this without too much trouble, but you need to know what you are doing. These people have trouble with VLOOKUP already (I mean the string/int problem is unintuitive, so I'm not talking about that), so this is an impossible task for them.
It's fun help a "savvy" Excel user understand how a relational database can reduce their byzantine VLOOKUP-based fever dreams into simple joins. Typically if somebody can grok VLOOKUP-fueled nightmares they can grok SQL pretty quickly and will actually appreciate what it can do for them.
They did, they called it Salesforce.com
Microsoft already has built that web-based access data-layer, it's called Dataverse - http://aka.ms/dataverse https://www.youtube.com/watch?v=iSKVxx_ghbw
One day, I asked him what it was and he showed me. He was running a series of excel macros that took over 96 hours to run, and fed a critical business process that was worth a few million dollars.
I sat down and took a look at it, and in about 3 days implemented a prototype in SQLite and a small Perl script that ran in about 8 minutes. Basically, it was a series of sql joins and some regex. My colleague, a project manager, literally hugged me and was near tears.
Some devs later took that prototype and refactored it to run on a normal production platform.
So we end up building the feature in Excel. With large (for Excel, say 100K-500K rows) data sets, it gets pretty slow. Or it'll get too complex, so we'll put it into our own Postgres DB.
Eventually, it'll get big/complex enough that we prioritize using development resources to automate the feature.
To an extent, this has become a standard part of our rigor for deciding whether or not to build features. You say you need X, but you aren't doing X today. Can't do you do that with an SQL pull and then doing all the business logic in Excel, and then creating the entries by hand? In some cases, the answer is no, we need it to be part of a larger pipeline, etc., but for a lot of things we do, building it by hand proves that the feature is needed, and also helps us work through the edge cases and makes writing the stories/BRD much easier. It also takes pressure off the dev team to try and intuit the true requirements.
checks latest
64mb spreadsheet that amounts to one gigantic, ever slower pivot table.
I feel called out. Maximum number of rows in a VLOOKUP in personal spreadsheet is like an array of 2x1000. In an earlier job, it was 13x39000. Excel automatically increases the range when you add rows in the middle. Then I split my data per year, & it was like 13x5000.
Copy/paste works flawlessly through the VDI into the putty session, so I usually just uuencode my blob, and copy it to destination cluster and uudecode there, instead of uploading the file to the VDI, then pscp to the bastion host, and then scp to the destination cluster. (I know of zmodem, port forwarding and such, none of this is allowed...)
Once upon a time at $workplace we had a production and development LAN and we had two PC’s sitting on our desks, one for prod and one for dev.
Now there was a special SMB share to move stuff between the two networks but trying to copy something from one Pc to the other was tedious.
So of course I wrote a magic clipboard utility that used a file on that SMB share as the clipboard “storage”. Running the utility on both PCs allowed me to use copy-paste between the two PCs…
might i introduce you to sed and awk?
Honest question though, as I have no experience with utilities like that: Could those tools together manipulate e.g. the data on the left to the graphs on the right?
depending on your windows, you might be able to take advantage of WSL or as a last resort run cygwin. maybe there are other methods of using awk/sed/grep type utilities as well, but I am not familiar.
i still remember the day when someone watching me struggling with large text files and took pity on me by showing me the light of the holy power of awk/sed/grep. it was taking minutes to make each search/replace edits and I had several of them. it took mere seconds for the shell commands to process the same thing.