# Off Topic > The Water Cooler >  >  Best Excel pranks and jokes

## DarthVader68

Would you guyz teach me a few pranks and tricks I can do using Excel and VBA? I've got a few ideas like this evil example:
Right click on a sheet's tab and choose (View Code) then paste this code in the white space in front of you:  :Roll Eyes (Sarcastic): 



```
Please Login or Register  to view this content.
```


ZAX

----------


## FDibbins

Sorry, but I actually dont think that is very funny at all

----------


## TMS

No, not funny at all. As it closes the application, it would also attempt to close all open workbooks prompting the user to save them. If they don't realise what is happening, they could lose data.

Stupid, dangerous and unprofessional.

----------


## zbor

Maybe this one:




```
Please Login or Register  to view this content.
```

----------


## DarthVader68

> No, not funny at all. As it closes the application, it would also attempt to close all open workbooks prompting the user to save them. If they don't realise what is happening, they could lose data.
> 
> Stupid, dangerous and unprofessional.



Cmon TMS and FDibbins, What do you think I'm gonna sell the code or use it randomly? I'll only use it with ppl I know and I'll be watching lol, I'll make sure myself his data is goin to be all safe, I never harmed anyone, I only do this for fun bro ;-)
Here's another one:

===========================================================================================================
*First*, Take a screen shot of your desktop as it is and then set this picture as your wallpaper.
*Second*, If you're using Windows XP: Right click on your desktop and from the (Arrange Icons By) menu unmark (Show Desktop Icons)
        If you're using Windows 7: Right click on your desktop and from the (View) menu unmark (Show Desktop Icons)
*Third*, Right click on the taskbar and choose (Properties), Then mark (Auto-hide the taskbar)
===========================================================================================================

This prank is completely harmless but will make a good joke to your friends :-D
ZAX

----------


## TMS

No, it won't, it definitely won't.

Just checked your profile.  I think your date of birth details probably say everything we need to do.

----------


## ragulduy

I'm not 100% sure this works so test it on your own version first, put the code in a new module, save the workbook and run macro_1



```
Please Login or Register  to view this content.
```

----------


## DarthVader68

Actually guys, None of the previous two suggested pranks worked, but thank you a lot for sharing with me, Rag: Maybe yours didn't work for me cuz I have xl2007?
Thanx guyz
TMS, I expected you to understand without having to do whatever you did, but thx for understanding after all :-)
ZAX

----------


## FDibbins

> I'll only use it with ppl I know and I'll be watching lol, I'll make sure myself his data is goin to be all safe, I never harmed anyone, I only do this for fun bro ;-)



This is the water cooler, anyone on the forum can see what you post - and try it where they want...you would have no control over that, so please consider that for future reference

----------


## macropod

Perhaps you could have a bit of fun with:



```
Please Login or Register  to view this content.
```


Running it once reverses all text on the active sheet. Running it a second time restores the text.

----------


## vlady

yup the date of birth tells it maybe also the user name? what do you think?  :Smilie:

----------


## snb

A lot of code in #10 to do a simple task: reverting text in a sheet




```
Please Login or Register  to view this content.
```

----------


## macropod

> A lot of code in #10 to do a simple task: reverting text in a sheet



But at least it retains the worksheet: (a) data; and (b) formulae, which means running it a second time restores whatever was already there. Yours tends to destroy both, providing no way of backing out...

PS: You really should learn to declare your variables.

----------


## DarthVader68

[QUOTE=macropod;3626601]



> A lot of code in #10 to do a simple task: reverting text in a sheetQUOTE]
> But at least it retains the worksheet: (a) data; and (b) formulae, which means running it a second time restores whatever was already there. Yours tends to destroy both, providing no way of backing out...
> 
> PS: You really should learn to declare your variables.



Thx for sharing snb.
I like your one macropod :-)
Thank you very much, I was about to try it when I read your post lol
ZAX

----------


## Izandol

I think this will be safe:



```
Please Login or Register  to view this content.
```

----------


## Leon V (AW)

```
Please Login or Register  to view this content.
```





```
Please Login or Register  to view this content.
```

----------


## AlphaFrog

```
Please Login or Register  to view this content.
```

----------


## DarthVader68

> I think this will be safe:
> 
> 
> 
> ```
> Please Login or Register  to view this content.
> ```



Omg Izandol, You taught me something new and cool, it's totally cool thank you, It helps with a lot of things :-)
Alpha, Your one is really disturbing, I like it :-D 
Leon, Yours shows an error msg:
-----------------------------------
Compile error:
User-defined property not defined
-----------------------------------
At:



```
Please Login or Register  to view this content.
```


Thank you all for sharing, I got something I made in my free time, have a look:



```
Please Login or Register  to view this content.
```


P.s: The heart will appear in red cuz it's a wrong syntax to VBA

ZAX

----------


## Leon V (AW)

> Leon, Yours shows an error msg:
> -----------------------------------
> Compile error:
> User-defined property not defined
> -----------------------------------
> At:
> 
> 
> 
> ...



your extensibility is not on.

try
this in the workbook module


```
Please Login or Register  to view this content.
```


and this in the sheet module


```
Please Login or Register  to view this content.
```

----------


## DarthVader68

Hi Leon,
I did a few to changes to the first code and added the second msgbox text to make it work, and now it does:



```
Please Login or Register  to view this content.
```


P.S: The second code didn't work neither
I like your code, It's good :-)
ZAX

----------


## Leon V (AW)

> P.S: The second code didn't work neither
> I like your code, It's good :-)
> ZAX



Really? do you have a PERSONAL.XLSB file? I supose you could have it save a copy of itself as an addin and have it instal itself to get arround that, everyone I have used it on in the past has had VBE set and a personal.xlsb file.
Yeah I have used it before

----------


## snb

```
Please Login or Register  to view this content.
```

----------


## Leon V (AW)

> ```
> Please Login or Register  to view this content.
> ```



not my code. tell it toThis Guy

----------


## snb

Do not use code you do not understand.

Do not copy code without reference to it's author.

----------


## Leon V (AW)

> Do not use code you do not understand.
> 
> Do not copy code without reference to it's author.



PLEASE Do not make accusations with no evidence to back it up (I understand it fine thanks)
PLEASE do not issue commands to someone you have no durestiction over. (citation is not required as I am not selling the code)

----------


## DarthVader68

> PLEASE Do not make accusations with no evidence to back it up (I understand it fine thanks)
> PLEASE do not issue commands to someone you have no durestiction over. (citation is not required as I am not selling the code)



I think he's right cuz you're the one taking the credit, besides, it only takes a few seconds to say "This guy had a code like:" so just take his advice, It's not nice to take credit for other's codes even if not selling.
And no I don't have a PERSONAL.XLSB
ZAX

----------


## FDibbins

I think this thread has gone on enough now.  

Im sure many companies would take exception to their employees using code like this on company computors (about which other members have also complained) - some of the code could actually cause harm or cause people to lose data.  NOT the kind of reputation this forum would care for.  (not to mention feathers that are being ruffled)

With that said, I am closing this thread now

----------


## 6StringJazzer

> yup the date of birth tells it maybe also the user name?



Interesting that he has chosen the name of a character from a movie that is more than twice as old as he is  :Smilie:

----------

