Good Excel Practical Jokes, Pranks, Mean Tricks, etc.

Just bumping this back up in honor of April Fool's Day (though I hate it with a passion).
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Here's a doosey, and you can call this from a worksheet! :LOL:

<pre><FONT COLOR="#00007F">Public</FONT> <FONT COLOR="#00007F">Declare</FONT> <FONT COLOR="#00007F">Function</FONT> FindWindow <FONT COLOR="#00007F">Lib</FONT> "User32" Alias "FindWindowA" _
(<FONT COLOR="#00007F">ByVal</FONT> lpClassName <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">String</FONT>, <FONT COLOR="#00007F">ByVal</FONT> lpWindowName <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">String</FONT>) <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>

<FONT COLOR="#00007F">Private</FONT> <FONT COLOR="#00007F">Declare</FONT> <FONT COLOR="#00007F">Function</FONT> SetWindowRgn <FONT COLOR="#00007F">Lib</FONT> "User32" _
(<FONT COLOR="#00007F">ByVal</FONT> hwnd <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>, <FONT COLOR="#00007F">ByVal</FONT> hRgn <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>, _
<FONT COLOR="#00007F">ByVal</FONT> bRedraw <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Boolean</FONT>) <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>


<FONT COLOR="#00007F">Private</FONT> <FONT COLOR="#00007F">Declare</FONT> <FONT COLOR="#00007F">Function</FONT> CreateEllipticRgn <FONT COLOR="#00007F">Lib</FONT> "gdi32" _
(<FONT COLOR="#00007F">ByVal</FONT> X1 <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>, <FONT COLOR="#00007F">ByVal</FONT> Y1 <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>, <FONT COLOR="#00007F">ByVal</FONT> X2 <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>, _
<FONT COLOR="#00007F">ByVal</FONT> Y2 <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>) <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>




<FONT COLOR="#00007F">Function</FONT> AlterEn()
<FONT COLOR="#00007F">Dim</FONT> hRgn <FONT COLOR="#00007F">As</FONT> <FONT COLOR="#00007F">Long</FONT>
hRgn = CreateEllipticRgn(0, 0, 150, 150)
SetWindowRgn FindWindow("XLMAIN", Application.Caption), hRgn, <FONT COLOR="#00007F">True</FONT>
<FONT COLOR="#00007F">End</FONT> <FONT COLOR="#00007F">Function</FONT></pre>

Go into a cell and enter

=AlterEn()

So much not manipulating the object via udf...
 
Just wanted to post an easier version to copy to the VBE:

Option Explicit

Public Declare Function FindWindow Lib "User32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function SetWindowRgn Lib "User32" _
(ByVal hwnd As Long, ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long

Private Declare Function CreateEllipticRgn Lib "gdi32" _
(ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, _
ByVal Y2 As Long) As Long


Function AlterEn()
Dim hRgn As Long
hRgn = CreateEllipticRgn(0, 0, 150, 150)
SetWindowRgn FindWindow("XLMAIN", Application.Caption), hRgn, True
End Function
 
I just thought of a prank by accident. I just copied some worksheets to sort them and suchlike. I removed the colour formatting from all of the cells on the sheet by setting the cell fill pattern to "No Fill". However, cell H2 was formatted with a yellow colour. It only took a minute to realise that I'd been messing with Conditional Formatting and forgot to remove the formatting for that cell. So, my prank is this:

Choose a cell or range of cells e.g. Cell A1
Goto Format|Conditional Formatting...
Select the condition Cell Value is Equal to A1
Insert whatever formatting conditions you want. e.g. make the background pattern yellow for that inexplicable miscellaneous cell whose formatting you can't change. Change the font colour to match the background for the classic "inivisble" cell contents.

The beauty of this one is that there is no VBA involved.
 
end all

This one's fun, use wisely...

Put this code in a standard module to declare function fTerminateWin(lngExitVal As Long).

http://www.mvps.org/access/api/api0016.htm

you can make a sub
Code:
sub endall()

fTerminateWin(0)

end sub

and..well,,,
their computer,
depending on what value you put in
fTerminateWin(HERE).
will:
0 - Terminates processes, then logs off.
1 - Powers the system off, if possible.
2 - Reboots the system.
3 - Forcibly terminates processes
when endall() is called.

Fun eh?
 
<font face=Courier New><SPAN style="color:#00007F">Dim</SPAN> NextTime <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Date</SPAN>

<SPAN style="color:#00007F">Sub</SPAN> Auto_Close()

StopClock

<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>

<SPAN style="color:#00007F">Sub</SPAN> Auto_Open()

StartClock

<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>

<SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> StartClock()

NextTime = Now + TimeValue("00:00:01")

Application.Caption = Format(Now, "mmmm d, yyyy hh:mm:ss AM/PM")
Application.OnTime NextTime, "StartClock"

<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>

<SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> StopClock()

Application.Caption = ""
Application.OnTime NextTime, "StartClock", Schedule:=<SPAN style="color:#00007F">False</SPAN>

<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>
 
This isn't an Excel prank or anything but if you're on NT you can always "net send" people from the Run prompt type:

net send PersonsUserName "Your message"

This displays a message on the recipients screen that says its from your computer name to their computer name. This is pretty funny to watch someones reaction to a message box they have never seen before (more than likely).
 
LTunnicliffe said:
This isn't an Excel prank or anything but if you're on NT you can always "net send" people from the Run prompt type:

This is a good one, I definitely have had some fun with this in the past. I do this via visual basic from excel with one of the following:

<font face=Courier New><SPAN style="color:darkblue">Sub</SPAN> NetSend1()
Shell ("cmd.exe /c net send ComputerName Hello.")
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">Sub</SPAN>

<SPAN style="color:darkblue">Sub</SPAN> NetSend2()
<SPAN style="color:darkblue">Dim</SPAN> WSpt <SPAN style="color:darkblue">As</SPAN> <SPAN style="color:darkblue">Object</SPAN>
<SPAN style="color:darkblue">Set</SPAN> WSpt = CreateObject("WScript.Shell")
WSpt.Run "cmd.exe /c Net Send IPADDRESS Whassup?", 0
<SPAN style="color:darkblue">Set</SPAN> WSpt = <SPAN style="color:darkblue">Nothing</SPAN>
<SPAN style="color:darkblue">End</SPAN> <SPAN style="color:darkblue">Sub</SPAN></FONT>

The Windows scripting method is nice as you don't create an instance of the Command Prompt. You can also use computer names or IP addresses. :devilish:
 
Funny story about "net send"...we had a guy here that was using this, and missed the spelling on the user name :unsure: , and his message went out to everyone on our network. Needless to say, he isn't here anymore, especially since the message came across with his computer name, and was composed of only two words.....

BITE ME! :eek:

That's right, if you're gonna send out the message via "net send", make sure you get that username/computer name/ip address correct. :devilish: Oh, and it just so happens that the President of our company was in that day, and received this nice little message on his computer. :whistle:
 

Forum statistics

Threads
1,216,172
Messages
6,129,289
Members
449,498
Latest member
Lee_ray

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top