Talk to your Foolish Computer using Microsoft Excel


“Computer, speak to me. What’s the weather condition?. Can I wander around?”
“Sir, are you blind? it’s raining outside you should not go and wander around.”
“I am not blind, i just don’t want look outside and don’t say bad thing to me. It’s getting on my nerves.”
“I see sir. you should have programmed me well so that i cannot say any bad thing to you”


Well, see, a lot of things can be done to your computer, even just Microsoft Excel can do this stuff.

Example,

Computer, IF human does not exist, what are you? THEN Computer says, I am Nothing
But what IF human exists, what are you? THEN Computer says “of course, I am a Computer! Stupid!

Imagine this,
From that conversation, converted into a VBA code or should I say a formula

IF human Exists THEN
       ” I am Nothing”
ElseIf human = Exist then
      “of course, I am  aComputer! Stupid!

note: is not equal
          =  is equal

Let’s try the IF formula in Microsoft Excel

The above example is different from this formula, but the logic remains the same.

Type the following:

  • On cell A1 = “If Human”
  • On cell B1 = “Computer:”
  • On cell B2 = =IF(B1=”exists”,”of course, I am a Computer! Stupid!”,IF(B1=”doesn’t exists”,”Iam Nothing of course”,””))

I will explain the formula on cell B2

Be sure you always include = sign for formula procedures

The IF function is the main function here (nothing else lol), IF is readable by the computer
that is when IF is change to IFZXY ,the computer cannot read this function. Meaning, the IFZXY function is not in the vocabulary words but the IF function is in the dictionary itself. Unless…… we insert quotation marks both sides, “IFZXY”, this will make a String but if we’re going to make this to a String, we do not have a function anymore that will command to the computer, so this is a non sense at all

It is much like a reading text written in bad penmanship. We will just insert a question mark after the word and proceed to the next word. Or a word that was a different language, Let’s say,
English –> House
Filipino –> Bahay
Americans do not understand the word “Bahay”, so they ignored it and put a mark on it, vice-versa (this is just only illustration)

After the IF function, we can now proceed to Logical test and value if true =If(Logical_test,[value_if_true])

As you know, If I type the word “exists” on cell B1 that is logical_test, because if the value of B1 cell is “exists”, it triggers our computer to think and to answer our question, so the computer’s answer is “of course, I am Computer! Stupid!” which is [value_if_true]

Now for the last thing, value if false =If(Logical_test, [value_if_true], [value_if_false])

It’s simple as A-B-C!

If the logical test is not correct, obviously the second value will rebound the logical test i.e., [value_if_false]

But as you can see in my formula, nested if, I have two IF functions, one is the main, and the other one is the sub-main

The sub main is in the false value of the main IF, because when the value of cell B1 change it to “doesn’t exists”
the first value (value if true) of the sub main will “Iam Nothing of course”  and the [value_if_false] of the sub main is “” which is blank, you cannot say “blank”, because literally the computer will print out this as “blank”

BIG NOTE HERE: Use comma for separation

Is this the real conversation with your computer? I guess it’s a BIG NO!

This the Real Talk what I’m saying about, the real talking computer that will speak to you

minor note: do not be afraid, it is just a program, but you can use it to amaze your friends


Let’s get started.

Open your workbook.

Click Developer Tab

Under Controls Group, Click Insert Drop down

Under Active X Controls, Insert CommandButton

Double click on it

From the code editor copy and paste this inside the Private sub

Dim SpeakToMe As Object
Set SpeakToMe = CreateObject(“sapi.spvoice”)
SpeakToMe.Speak “Hello Mr. Edvinne Capistrano”

“Hello Mr. Edvinne Capistrano” —> you can change this
Close the code editor.
Now ready your speaker or headset,
Hit the button. 🙂
For my next post, it will be more interesting because I will teach you how to utilize more of the SpeakToMe program (sapi spvoice).

Download SpeakToMe.xlsm
Download IF Tutorial.xlsx

Make sure your macro settings were enabled for you to run this .xlsm extension

(if you don’t trust these files, scan first using your anti-virus or anti-malware)

Don’t forget to subscribe or follow me on google + for more future posts

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s