Begin by opening a new sheet in Excel. Click "File" and go to the bottom left and press "Options". Click the "Customize Ribbon" button. Go to the right side panel and click the check box that says "Developer".

Click the "Trust Center" button in the far left side bar and go to "Trust Center Settings...". From here click "Macro Settings" button in the new left side bar and select "Enable all macros" and check the box beneath that says "Trust access to the VBA project object model". Click the "Ok"s at the bottom of the menu.

I can sense your eagerness. Calm down. There are a few more steps.

From here, go to the "Developer" tab and press the "Visual Basic" button. This is what you should see. Right click the folder that says "Microsoft Excel Objects", hover over "Insert" and then press "Module". Double click into the new module that just appeared.

You're almost there.

Copy this spoilered code into the white space to the right.

'start shirking obligations
Sub cmdStart_Click()
Dim x As Long
For x = 1 To 1000000000
Cells(7, 2) = "Running"
Cells(1, 1).Select
SendKeys "{down}"
Application.Wait (Now + TimeValue("0:00:02"))
DoEvents
Next x
End Sub

'stop shirking obligations
Sub cmdStop_Click()
Cells(7, 2) = "Not Running"
End
End Sub

'will automatically set to not running upon opening workbook
Private Sub Workbook_Open()
Cells(7, 2) = "Not Running"
End Sub

_
Home stretch. I can sense that you're ready to give your boss the finger. We're so close.

Close the Visual Basic window and go back to "Sheet1" or whatever it is called. Under the "Developer" tab, press the button that says "Insert" and under the "Form Controls" section select the top left button, which is "Button". Press anywhere in the sheet, hold and drag the mouse to create the button. A menu will appear demanding that you select a macro for the button, select "cmdStart_Click". Do this again with another button to the right but select "cmdStop_Click" in the popup menu. These are your start and stop buttons if that isn't painfully obvious. Rename them if you want, I really don't care.

You're spreadsheet should look like this. Go to "File" and select "Save As". Click "Browse" and save it wherever the fuck you want. The main thing you want to pay attention to is selecting "Excel Macro-Enabled Workbook (*.xlsm)" in the "Save as type:" dropdown. This will let you reuse the workbook.

Congratulations. You're now ready to shirk your obligations at your bullshit job. Have fun. Use it wisely.

  • captcha [any]
    ·
    4 years ago

    This does not surprise me in the slightest since it was what I was automating with VBA. The folder I was moving files from was an sFTP server with ftp user names as sub folders. The other folder was a network drive with the subfolders companies full name (plus ever changing comments).

    The reason we couldn't automate this system further was because companies would never obey our file format from understandable to insane degrees. The file format was a stupid .xls format but we would get CSV files saved with the .xls extension or just a completely different format. So after I moved all the files the next step was to go through at "massage" all the data into a format our importer could use.

    This was a company accepting employee data from other companies so I got to see just how bad some other companies were at following. I'm talking international tech companies, entire states, and university systems fucking up a basic excel file.

    All this meant errors were common which meant more call center temps. Companies would leave us for a smaller competitors only to come back to us after we acquired the competitor.