Ruddles
Well-known Member
- Joined
- Aug 24, 2010
- Messages
- 5,851
- Office Version
- 365
- Platform
- Windows
Here's a tiny time-waster for a Friday which may push your understanding of VBA...
Paste the following code into the VBA Immediate window - or make it into a procedure if you're so inclined - and try to guess the outcome in advance:-<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
<o></o>
Was it what you were expecting?
<o></o>
<o></o>
Now try these:-<o></o>
<o>
</o>
Hands up anyone who got them all right?
Paste the following code into the VBA Immediate window - or make it into a procedure if you're so inclined - and try to guess the outcome in advance:-<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
Code:
[FONT=Courier New][COLOR=black][COLOR=black][FONT=Courier New]if 1 = 2 or 3 then msgbox "1 equals 2 or 3"[/FONT][/COLOR][/COLOR][/FONT]
Was it what you were expecting?
<o></o>
<o></o>
Now try these:-<o></o>
<o>
Code:
[COLOR=black][FONT=Courier New]if 7 = 99 or 1001 then msgbox "7 equals 99 or 1001"[/FONT][/COLOR]
Code:
[COLOR=black][FONT=Courier New]if (6 and 11) = 2 then msgbox "6 and 11 equals 2"[/FONT][/COLOR]
Hands up anyone who got them all right?
Last edited: