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

I think I could go one further. One could actually create a list of things to speak, in order. Each time a shortcut is pressed, it speaks the next item in the list. That way you could you play mind games. The following exhibit plays each line of "Can't touch this" each time a shortcut is pressed...


Excel 2010
AB
1My, my, my music hits me so hardX
2Makes me say "Oh my Lord"
3Thank you for blessing me
4With a mind to rhyme and two hype feet
5It feels good, when you know you're down
6A super dope homeboy from the Oaktown
7And I'm known as such
8And this is a beat, uh, you can't touch
9I told you homeboy, (You can't touch this)
10Yeah, that's how we living and you know, (You can't touch this)
11Look at my eyes, man, (You can't touch this)
12Yo, let me bust the funky lyrics, (You can't touch this)
Sheet1


In a standard module:
Code:
Public Sub SpeakNextItem()
    Dim lngCurrentRow As Long
    Dim lngLastRow As Long
    Dim lngNextRow As Long
    
    With Sheet1
        lngCurrentRow = Application.Match("X", .Columns(2), 0)
        lngLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
        With .Cells(lngCurrentRow, "A")
            Application.Speech.Speak .Text
            .Offset(, 1).Clear
        End With
        If lngCurrentRow = lngLastRow Then
            lngNextRow = 1
        Else
            lngNextRow = lngCurrentRow + 1
        End If
        .Cells(lngNextRow, "B").Value = "X"
    End With
End Sub

Public Sub NewKeys()
    With Application
        .OnKey "^a", "SpeakNextItem" 'select all
        .OnKey "^b", "SpeakNextItem" 'bold
        .OnKey "^c", "SpeakNextItem" 'copy
        .OnKey "^f", "SpeakNextItem" 'find
        .OnKey "^h", "SpeakNextItem" 'find & replace
        .OnKey "^i", "SpeakNextItem" 'italic
        .OnKey "^o", "SpeakNextItem" 'open
        .OnKey "^s", "SpeakNextItem" 'save
        .OnKey "^u", "SpeakNextItem" 'u
        .OnKey "^v", "SpeakNextItem" 'paste
        .OnKey "^w", "SpeakNextItem" 'close
        .OnKey "^x", "SpeakNextItem" 'cut
        .OnKey "^y", "SpeakNextItem" 'redo
        .OnKey "^z", "SpeakNextItem" 'undo
    End With
End Sub

Public Sub ResetKeys()
    With Application
        .OnKey "^a" 'select all
        .OnKey "^b" 'bold
        .OnKey "^c" 'copy
        .OnKey "^f" 'find
        .OnKey "^h" 'find & replace
        .OnKey "^i" 'italic
        .OnKey "^o" 'open
        .OnKey "^s" 'save
        .OnKey "^u" 'u
        .OnKey "^v" 'paste
        .OnKey "^w" 'close
        .OnKey "^x" 'cut
        .OnKey "^y" 'redo
        .OnKey "^z" 'undo
    End With
End Sub

If you manage to get onto a colleagues machine, create your own list and paste it to a sheet in his/her personal workbook. Add the code to a standard module and then run 'NewKeys'.

Remember to reset the keys (run 'ResetKeys') before it goes too far and you get fired.

*Course this doesn't work if speakers are turned off. You can fiddle that with API, but I think that's just going too far. :biggrin:
 
Last edited:

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
You're so lazy Joe!
I believe that is the credo of a good programmer!

I always ask myself, can I be lazier?
Is there a quicker/easier way of doing this?

Laziness is the mother of invention!!!:biggrin:
 
I thought necessity was the mother of invention?
Common misperception...

Actually, on another site I was on some years back, my signature was something like:
If necessity is the mother of invention, then laziness is certainly the au pair!"
 
Revisiting the Reverse Menu Post

The post about reversing the menu looks like the perfect prank to use on my boss who is a good sport. Looking at post #190, I inserted it into a module:

Code:
Sub strreverseMenuText()
'enable quoted lines if you get in trouble !!
'restore only the reversed menus
On Error Resume Next

    For Each m1 In Application.CommandBars(1).Controls
        'If MsgBox(m1.Caption, vbYesNo,"RESTORE ?)) = vbYes Then
    m1.Caption = StrReverse(m1.Caption)
            For Each m2 In m1.Controls
            m2.Caption = StrReverse(m2.Caption)
                For Each m3 In m2.Controls
                m3.Caption = StrReverse(m3.Caption)
                Next m3
            Next m2
        'End If
    Next m1
    
End Sub

I have a statement where if my boss types his name into a certain cell, then it calls the Sub. It is not working for me (nothing happens). I tried it on two different computers - one with Excel 2007 and the other with 2010. Do I need something more than what is shown in the code above?

Thanks,
Mark
 
Excel 2010<TABLE style="BORDER-BOTTOM: #bbb 1px solid; BORDER-LEFT: #bbb 1px solid; BACKGROUND-COLOR: #ffffff; BORDER-COLLAPSE: collapse; BORDER-TOP: #bbb 1px solid; BORDER-RIGHT: #bbb 1px solid" rules=all cellPadding=2><COLGROUP><COL style="BACKGROUND-COLOR: #dae7f5" width=25><COL><COL></COLGROUP><THEAD><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #dae7f5; COLOR: #161120"><TH></TH><TH>A</TH><TH>B</TH></TR></THEAD><TBODY><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">1</TD><TD>My, my, my music hits me so hard </TD><TD>X</TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">2</TD><TD>Makes me say "Oh my Lord" </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">3</TD><TD>Thank you for blessing me </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">4</TD><TD>With a mind to rhyme and two hype feet </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">5</TD><TD>It feels good, when you know you're down </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">6</TD><TD>A super dope homeboy from the Oaktown </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">7</TD><TD>And I'm known as such </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">8</TD><TD>And this is a beat, uh, you can't touch </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">9</TD><TD>I told you homeboy, (You can't touch this) </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">10</TD><TD>Yeah, that's how we living and you know, (You can't touch this) </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">11</TD><TD>Look at my eyes, man, (You can't touch this) </TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">12</TD><TD>Yo, let me bust the funky lyrics, (You can't touch this)</TD><TD style="TEXT-ALIGN: right"></TD></TR></TBODY></TABLE>
Sheet1


I think you misspelled some of the lines. They look like this:

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

:cool:
 

Forum statistics

Threads
1,215,299
Messages
6,124,125
Members
449,142
Latest member
championbowler

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