Thursday, June 6, 2013

Excel Pranks and Practical Jokes with VBA

I’ve shared a lot of Excel tips about how to increase your productivity at work but today I thought I would post something a little more fun – how to decrease your productivity! I’m talking about ways to use Microsoft Excel spreadsheets to play pranks, practical jokes, April Fool’s Day kind of stuff on your friends, roommates, and coworkers. The intent is not to harm anyone or hurt their professional careers – this is simply about having some plain ole fun.

A great way to wreak havoc in the workplace is to create a macro that automatically runs when an Excel workbook is opened. You can do this by writing a VBA procedure in the Open event of the workbook by using the Visual Basic Editor. Create a new Excel spreadsheet then press Alt+F11 to launch the VBA Editor. Next, right-click the ThisWorkbook object, and then click View Code.
excel pranks
In the Object list above the Code window, select Workbook. This will automatically create an empty procedure for the Open event like this and you can now add your evil code.

excel practical jokes
To make Excel automatically close itself when the workbook is opened use this:

Private Sub Workbook_Open()

     Application.DisplayAlerts = False
     Application.Quit
End Sub


Here’s a trick that will automatically open Microsoft Word and close Excel:

Sub Workbook_Open()
‘make sure the Microsoft Word Object Library is selected by going to tools>references

Application.Visible = False
Dim wdApp as Word.Application
Set wdApp = New Word.Application
wdApp.Visible=True
Set wdApp = Nothing
Application.DisplayAlerts = False
Application.Quit
End Sub


This is one of my personal favorites; have a message box pop-up asking if the user wants to download the virus they requested. Whether they press the yes or no button the next message tells them the virus has begun downloading!

Private Sub Workbook_Open()

MsgBox "The virus you requested is now ready to download, Do you want to start downloading now?", vbYesNo, "Virus Trojan-x45fju"

MsgBox "The Virus is Now Downloading. You have made the biggest mistake of your life! ByE bYe", , "Begin Virus Download"

End Sub

This function flips the workbook and will make everything on the left now appear on the right side:

ActiveSheet.DisplayRightToLeft = True

To change all cell’s color to black:

Cells.Interior.Color = RGB(0,0,0)

Instead of automatically running a macro on opening a workbook (and making it obvious you did something) you could embed a macro that only runs on certain conditions. A funny prank is a macro to change the size of the Excel window every time the user clicks on a cell:

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)

Application.WindowState = xlNormal

Application.Width = Int(Rnd() * 1000) - 100

End Sub


As you can imagine, the possibilities are nearly endless! Now you may think “All someone has to do is change or delete the code to fix the problem.” Well, you can protect your VBA code so only those with the password can modify it. Go to Tools>VBAProject Properties>Protection. Check the box to lock project for viewing and create a password (and remember it). Now you’re an evil genius!




Of course, if you’re not comfortable using VBA (which I recommend you get comfortable and learn it)  you can always use these old fashioned tricks:

  1. Use find and replace on a document, like replacing “you” with “you idiots”.
  2.  If your coworker has an old school mouse simply remove the ball when they're not around and then sit back and watch the fun when they try to figure out why their mouse isn't working anymore.
  3. Take a screen capture of a roommate’s desktop and save it as a jpg or bmp file. Turn on the Active Desktop, and make sure to turn off "show desktop icons". Change the wallpaper to the screen capture image you just saved and watch as they click away on their "icons" that mysteriously stopped working.
Or, you can use a device like the Phantom Keystroker.

Have you ever used something like this on someone? What’s your best Excel prank?

Sunday, April 28, 2013

2012-2013 NHL Stanley Cup Playoff Printable Bracket

The 2012-2013 NHL regular season has ended and the Stanley Cup playoffs are here which means it's time to download, print, and fill out your NHL Playoff Excel bracket. I have created a downloadable Excel spreadsheet with the complete NHL playoff bracket. Fill it out on your computer or print it out. Maybe next year I'll get around to adding a bracket manager in order to keep score in a pool. Download the 2013 NHL bracket here or sign-up for my Excel tips newsletter to receive the .xls file as an email attachment (you can unsubscribe at any time).


2013 nhl stanley cup playoffs printable bracket


One note about the Stanley Cup playoffs - unlike March Madness the top seed always plays the lowest seed so you may have to reshuffle the picks on your bracket after the first round. I just updated the spreadsheet and added the 2013 NHL playoff schedule including the date, location, time, and TV network for all the games in the first round of the playoffs.


2012-2013 NHL Stanley Cup Playoff Printable Excel Bracket.xls download

Thursday, April 18, 2013

2013 NBA Playoff Bracket Download

The NBA Playoffs start on Saturday, April 20th (two days after the end of the regular season), thus you don’t have a lot of time to complete your 2013 NBA Playoff bracket. All the first games of the eight first round match-ups will take place on either April 20 or 21st.

The NBA playoff structure is a bit unique in that there are no first round byes, all sixteen teams (eight from each conference) compete in the first round of the playoffs. The format of the NBA playoffs consists of each team needing to win four out of seven games in order to advance to the next round. In the first three rounds of the playoff the series follow this home and away format: HHAAHAH.  The Finals follow the format: HHAAAHH.


Miami has clinched the number one seed in the East while Oklahoma City wrapped up the West. My Cleveland Cavaliers will be watching from home again. Who do you think will win the title? Miami has looked nearly unstoppable this season and I think it will be a major shock and upset if they do not win it all. What about you?

2013 NBA Playoff Bracket.xls download

Tuesday, April 16, 2013

Unique Excel Uses: Video Game

We’ve seen some very unique Excel uses in the past but this just might be the best (or most fun) application: Excel as a video game! Cary Walkin, a Canadian accountant, has transformed a Microsoft Excel spreadsheet into a playable video game. Arena.xlsm is a turn-based fantasy role playing game where the goal is to collect loot to become more powerful all the while warding off increasingly difficult  monsters. In fact, there are currently over 2000 possible enemies with different AI abilities. Sounds complex! Remarkably, it only took Cary four months to completely program this game.

arena xlsm excel as video game


Cary has received a lot or press and attention since creating his Excel game. Recently, he was featured on one of Reddit’s “I Am A” features. A few quotes from Cary:

“I'm an accountant by profession, I use excel every day of my life. I simply worked with what I knew. Also there is an old adage that underneath every RPG is a massive spreadsheet, so now the massive spreadsheet IS the RPG!”

“...a number of calculations are dependent on the background colour of a cell (such as if you are standing on fire).”

“Never stop learning.”


Read the entire interview feature here. Additionally, to see an example of how one would even begin to go about coding this massive gaming macros see Cary’s great VBA tutorial here.

Visit Cary’s site and download Arena XLSM today and try it out for yourself! But be warned, your productivity may decrease greatly after playing a few levels.  Please note you must have macros enabled in order to play the game. Arena.Xlsm will only work in Excel 2007, 2010 and 2013. It will not work in other spreadsheet programs either. Have fun!

-Nick
Of course I’m not playing this at work ;)

Tuesday, April 9, 2013

My Excel 2016 Wishlist

Today, I started thinking about my Excel 2016 wishlist. Microsoft Excel has been updated every three years beginning in 2007. Knowing this, we can only assume the next edition of Excel will come out in three years from now in 2016. The latest update, Excel 2013, includes new tools like FlashFill, PowerView, Timeline Slicer, and over 50 new functions. Don’t get me wrong, Excel is a very powerful tool but it’s not completely perfect yet.
excel 2016 logo

Thus, it’s never too early to start thinking about the next edition of Excel and what improvements can be made. There are a number of features that I think would make creating spreadsheets even easier. A couple of simple improvements could help save users even more time. Here are some of the things I’d like to see in Excel 2016:



  • A FIXTODAY() function that holds the date of the day the formula was first created or entered into the spreadsheet.
  • I don’t know if this will ever be possible outside of Google Docs but allowing multiple users to edit the same document at the same time would be wonderful.This would eliminate all those extra copies of spreadsheets floating around.  This option is already available!
  • I don’t know why you can’t do this already but it would be great to be able to unhide multiple worksheets at the same time. Currently, you can only unhide one sheet at a time which can be a major headache and quite inconvenient.
  • Along this same line, I would like the ability to unprotect multiple sheets at once. Something like a global password may be the solution.
  • An easy way to be able to see exact revision history.
  • More options when protecting a sheet, like being able to use CustomViews.
  • More text manipulation functions and options.

That’s what I think. What about you? What would you like to see in future versions of Excel? What’s on your Excel 2016 wishlist? Please let me know in the comments below. Who knows, maybe Microsoft will even be taking notes!

Monday, March 18, 2013

2013 NIT Bracket Spreadsheet

2013 NIT Bracket
 
If you’re an avid NCAA men’s basketball fan and March Madness isn’t enough for you than you can also download the 2013 NIT Tournament Bracket. The National Invitation Tournament is comprised of many of the teams that some argue should have been in the NCAA tournament field but got left out. You would think all of these teams would be really bad when in reality some automatic bids to the NCAA tourney go to really bad teams (twenty loss Liberty, for example) thus teams like Kentucky, Iowa, Ohio University, are forced out of the field of 68 and into the NIT. This is still a good thing for these teams because they get the extra practices with come with the postseason while the other teams are sitting at home until next year.

This bracket is pretty straight forward. I’ve included the dates, times, and TV coverage for each game. However, there is no Pool Manager for the NIT spreadsheets (have you ever heard of anyone running an NIT pool anyways?).

Sunday, March 17, 2013

Downloadable 2013 NCAA Tournament Bracket

The downloadable 2013 NCAA Tournament Brackets are here! It's finally time to download and print your 2013 March Madness Brackets. I’ve made my own tournament brackets for almost every other major sporting event (see them all in the downloads page) but I’ve never attempted to make my own March Madness brackets. Why? Because for the last several years I've used David Tyler's spreadsheets, which I consider to be the best NCAA Excel brackets out there and are nearly flawless in my opinion. They're free to download too!

downloadable 2013 ncaa tournament bracket

David has created two separate files: the actual tournament brackets where you predict the winners of each game and a separate bracket manager for office pools. You must use his brackets in order to use the pool manager (and make sure macros are enabled).
2013 march madness pool manager
Download the 2013 NCAA Tournament Bracket.
Download the 2013 March Madness Pool Manager

Instructions are included with the spreadsheets. To learn more about how the brackets are created read our interviews with David from 2010 and 2011. Also, be sure to visit David’s website, When the Whistle Blows.

My Buckeyes won the Big Ten Tournament and are one of the hottest teams in the nation right now. Who do you have winning the big dance? Let us know in the comments below!

If you would like to you can join my basketball pool on Yahoo's Tourney Pick'em.