How I went home early after automating my job.

私は仕事をMicrosoft Excelで自動化した後、正午に帰宅することができました。

シカゴ・ボード・オブ・トレードで貿易フローマネージャーとして働いていたとき、COOから突然新しい業務を任されました。通常であればシフトに数時間追加することになりそうなこの業務でしたが、結果的に午後の時間を取り戻し、最終的には昇進と昇給につながりました。

背景

シカゴの中心部には、顔のない素晴らしい女神の像が立っています。彼女は農業の女神セレスです。その足元にはシカゴ・ボード・オブ・トレードビルがあり、毎日何十億ドルもの取引が行われています。その一部の取引の流れを管理するのが私の仕事でした。

当時、私は為替取引部門での取引管理を担当していました。私たちの顧客は、ドル、円、ポンド、トルコリラ、ポーランドズウォティなど、世界中から様々な通貨で取引していました。顧客が取引を行うたびに、会社のOutlookアカウントに取引の詳細(取引額、行使価格、時間など)が記載されたメールが届きました。

最初はそのメールをあまり活用していませんでした。部署内の同僚が上司に取引の要約を報告していたので、彼がメールを参考にしていたのだと思います。私自身は、当時PCで古いDOSシステムを使っており、黒い画面に緑色のブロック状の文字が表示されるものでした。2010年代にもかかわらず、数千万ドル規模の取引を原始的な技術で管理していたのです。しかし、詳細な報告が毎日必要になったのです。

選択肢は、スクリーンに表示される取引を全て書き写す、確認メールのテキストをコピーして報告書やExcelに貼り付ける方法がありましたが、どれも時間がかかりそうでした。それで私は新しい解決策を考えることにしました。

私は後者を選びました。Alt+F11を押してExcelのVBAエディタを開き、コードを書いて自動化プロセスを実行しました。数行のVBAコードで、Outlookフォルダ内のメールから当日のメールのみを抽出し、必要な情報を自動的に取得するようにしました。また、取得したデータをExcelで表にまとめ、最終的にPDFとして保存し、PCに保存されるようにしました。日々の終わりにはそのファイルをC-Suiteの幹部に簡単にメールで送信できました。

それで満足していたのですが、さらに改善したくなりました。

調子に乗って、さらにいくつかの指示をExcelに追加しました。ファイルを保存した後、幹部のリストに自動的にメールを送信するようにしました。作成したメール機能をテストしたところ、完璧に動作しました。最後に必要だった機能が一つだけ残っていました。

Excelファイルが開かれると同時にこのマクロが実行されるようにし、完了後にExcelファイルを閉じるように指示しました。最後に、Windowsの内蔵機能を使って毎日同じ時間にこのExcelファイルを開くようにタスクを設定しました。これでプロジェクトは完了です。

毎日午後4時にWindowsがファイルを開き、マクロがすぐに実行され、受信トレイをスキャンし、データを抽出して報告書にまとめ、上層部に自動的に送信されます。その後、ファイルが自動で閉じられるため、翌日も同じタスクに備えることができます。

初日はファイルが開いて動作し、その後閉じる様子を見守りました。翌日はPCに触れずにそのままにしておきました。三日目には昼食後にオフィスを出ることにしました。小規模なチームで働いていたため、昼食後はアジアとヨーロッパの取引が終了し、取引量が大幅に減少していました。私かチームの誰かが残れば、その取引量は十分に管理できました。

もちろん、設定したメールリストには自分もBCCで含めていました。家でビールを飲みながら庭でリラックスしている時、自分からのメール通知が携帯電話に届きました。そこには取引の要約が含まれていました。

その後、交代でオフィスを早めに出ることができるようになりました。誰かが閉店まで残れば、容易に管理できました。この効率化に誰も気づかずにいましたが、ある日COOが私を探しに来ました。

COOは取引の要約メールを受け取った後、私が退社する前に捕まえようとしました。もちろん、私はその時既に帰宅していました。COOは、ほんの数分前に私からメールが届いたばかりで、困惑しているようでした。

翌日、私たちは会議を行いました。私は自動化の仕組みを説明し、他の部署でも同様のシステムを導入できると話しました。VBAを使えば何でも可能です、と伝えました。早退を咎められることなく、むしろ称賛され、他の部署にも紹介され、昇進しました。

English Version:

I was able to go home at noon after automating my job using Microsoft Excel.

While working in Chicago as a trade flow manager at the Chicago Board of Trade I was suddenly given a new assignment from the COO. An assignment that would normally have added hours to my shift ended up allowing me to get back my afternoons, ultimately leading to my promotion and raise.

Background 

In the heart of Chicago stands a marvelous, faceless, statue of a goddess. She is Ceres, the goddess of agriculture. Beneath her feet is the Chicago Board of Trade building, where billions of dollars in trade flows through every day. Managing the flow of some of those trades was my job.

At the time, I was managing trades for our FX division. We had clients all over the world trading dollars, yen, pounds, Turkish lira, polish zloty, anything really. Each time a client executed a trade I would receive an email to my company outlook account. The email had details such as trade amount, strike price, time, etc. 

At first I didn’t really use those emails for much. One of the guys in my department sort of gave a summary of the day’s trades up to the bosses, I guess he must have used them as a guide. , For me, I was using an old dos system on our PCs, the kind with blocky green text on a black screen. This was during the 2010s and the trade values were in the tens of millions of dollars and yet we still used primitive technology, but I digress. So, I saw the trades come and go in real time and didn’t make many reports. Now, however, they wanted a more detailed report every day.

The options were: write down every trade that came across the screen, an endeavor I would absolutely never do. Copy and paste the text from the confirmation emails into a summary report, word file or excel sheet, which would work but take hours, or devise a novel solution.

I chose the latter. Pressing alt+F11 I opened up the VBA editor in Excel, where you can write code and automate processes. With a few lines of VBA I was able to have Excel extract the text from within the emails in my Outlook folder, making sure to only use the emails from the day’s date. I also had it scan the text for the key information I was looking for and isolate it. Next, I had Excel summarize all the data in a nice table. Finally, I was able to save the table as a pdf and have it saved onto my PC. I could then easily email that file to the C-Suite executives at the end of the day.

It worked well, and I was reasonably satisfied, but I wanted more.

I was on a roll, so I added a few more instructions to Excel: after saving the file, automatically email it to a list of executives. I tested the email feature I had just made and it worked perfectly. There was one final feature I needed. 

I instructed this macro to run as soon as the Excel file itself was opened. And I instructed it to close the Excel file as soon as it had finished. Finally, I set a task using a built in feature in Windows that would open this Excel file every weekday at the same time. The project was now complete.

Everyday at 4:00 pm Windows would open the file, the macro would execute immediately, scanning my inbox, extracting the data, summarizing it into a report which was then automatically sent to the higher ups. The file then closed itself so it would be ready for the same task the following day. 

The first day I watched it open, operate, then close. The following day I left my computer untouched. The third day I decided to leave the office entirely after lunchtime. I worked with a small team and after lunch both the Asia and European regions would be finished trading for the day, so our volume was greatly decreased. As long as I or someone from my team remained, the volume would be easy to handle.

Of course, I included myself as a bcc in the email list I had set up. While I was at home, probably sipping a beer in the garden, I received an email notification on my phone. It was from myself and included the summary of trades.

After that, we would take turns leaving the office early, as long as someone stayed until closing, we would be able to easily manage and no one was aware of our new efficiency. That is, until the COO came to find me at the end of the day.

When the COO received the trade summary he came down to catch me before I went home. Of course, I wasn’t actually there, I had left long before. He seemed confused because he had literally just received an email from me moments ago.

The following day we had I meeting. I explained the automation and that it was quite easy to do. It could even be replicated by other departments. Anything was possible with VBA, I said. Rather then getting in trouble for leaving early, I was commended. I was recommended to other departments and given a promotion.