Time to read: 3 min read
After I won a scholarship from Audi Hungária, which helped me finance my 5th. semester in Karlsruhe, they were happy to later see me apply for an internship.
So I became an engineering intern at the electric drivetrain manufacturing section. Our team worked out the nuances of manufacturing technology, which led up to the opening of the electric motor factory in the summer of 2018.
In the first few weeks I familiarized myself with the testing machines and operated them at times. This includes high voltage tests at various stages of assembling, leakage tests and an overview of the workings of the break tester.
As I was fresh and new, I've been given a wide range of makeshift tasks, which surprisingly often sat me in front of an excel sheet. One time I was asked to import thousands of CSV files into a sheet, which had a macro implemented for some of the tasks after import, so it was still incredibly tedious and repetitive. It took me two full days to finish. After that I started tinkering with some basic VBA code from StackOverflow. Shortly, I managed to write a program, that automatically reads each of the thousands of files from the specified folder, and includes them in the original sheet without screwing up the diagrams.
Diagrams look at a range of rows. They will tolerate pasting new rows inside of the specified range, and adjust themselves automatically. But they won't tolerate deleting every row and then pasting new ones. So in my script I deleted all rows except for the first and the last one, pasted new data in the middle, and finally removed the outer ones.
I even made the file make a safe copy of itself first, just to have a snapshot of previous states. And I had the program it freeze the screen for the time it computes (instead of flickering wildly between csv files and sheets), and then send an alert when it's done.
The success I got from this relatively simple script encouraged me to update another Excel sheet we used often. It contained the daily report, and was sent to the boss via email every day. I had it's previous macro cleaned up at the code level, automated cell coloring and styling (which the previous macro used to mess up every time). But the biggest trick was making the sheet compose an email (in two languages, with correct dates) and attach itself to it. From then on we just had to press Ctrl+E, have a glance at the email draft in Outlook that just popped up, and press send. The basic building blocks of all of these VBA programs are included in my github page.