Printer Friendly
The Free Library
14,794,102 articles and books
Member login
User name  
Password 
 
Join us Forgot password?

The automated spreadsheet.


EXECUTIVE SUMMARY

* A SPREADSHEET spreadsheet

Computer software that allows the user to enter columns and rows of numbers in a ledgerlike format. Any cell of the ledger may contain either data or a formula that describes the value that should be inserted therein based on the values in other cells.
 CAN ALERT YOU to significant changes in data in a network database or on the Internet Internet

Publicly accessible computer network connecting many smaller networks from around the world. It grew out of a U.S. Defense Department program called ARPANET (Advanced Research Projects Agency Network), established in 1969 with connections between computers at the
.

* TO TRIGGER THE ALERTS, all you need is a computer that's linked to the Internet and the special code to command your spreadsheet application to search for the data.

* IT IS, POSSIBLE TO:

* Track stock market activity.

* Monitor new information in your organization's database that requires a rapid response.

* Keep a corps of business travelers current on different key market or inventory information.

You're you're  

Contraction of you are.


you're you are
you're be
 about to leave on a business trip. You've you've  

Contraction of you have.


you've you have
you've have
 packed your laptop Same as laptop computer.

laptop - portable computer
, Palm personal digital assistant, e-mail pager and cell phone. Yet despite all of this high-tech high-tech also hi-tech
adj. Informal
Of, relating to, or resembling high technology.


high-tech
Adjective

same as hi-tech

Adj. 1.
 equipment, you feel disconnected from your office even before you board the plane. After all, you realize that being on the road significantly increases the possibility you won't won't  

Contraction of will not.


won't will not
won't will
 be able to adequately monitor your business even if you can remotely connect to the Internet.

What if you had a function that could robotically perform some of the

monitoring for you--automatically, 24 hours a day, seven days a week--and alert you when it's it's  

1. Contraction of it is.

2. Contraction of it has. See Usage Note at its.


it's it is or it has
it's be ~have
 appropriate?

Well, you probably already have that power--Excel--in your briefcase In Windows 95/98, a system folder used for synchronizing files between two computers, typically a desktop and laptop computer. Files to be worked on are placed into a Briefcase, which is then transferred to the second machine via floppy, cable or network. . But to use it you need a computer that's linked to the Internet.

This article will show you how to use Excel A full-featured spreadsheet for Windows and the Macintosh from Microsoft. It can link many spreadsheets for consolidation and provides a wide variety of business graphics and charts for creating presentation materials.  to search for the data you need and then, when certain preset preset Cardiac pacing A parameter of a pacemaker that is programmed permanently when manufactured  criteria are met, alert you to take action--wherever you are.

Here are some of the things the Excel function can do:

* Track stock market activity. Excel can import current stock market data from the Internet and alert you by e-mail to critical market changes that require immediate action.

* Monitor information in your organization's database that requires a rapid response. For example, alerts can be triggered by significant overtime on an engagement, unusually large sales, orders from your largest customers, receipt of an important shipment, failure to deliver products at specified times, unexpected changes in production quality or quantity, spending in excess of budgeted limits and unusual ratio fluctuations. You can program Excel to send e-mails to selected people in response to an alert.

* Keep a corps of business travelers current on key market or inventory information. Excel can automatically activate e-mails to those out of the office, notifying no·ti·fy  
tr.v. no·ti·fied, no·ti·fy·ing, no·ti·fies
1. To give notice to; inform: notified the citizens of the curfew by posting signs.

2.
 them of changes in service or product prices, product availability, special discount offerings--and each person will receive only personally relevant information.

Now let's let's  

Contraction of let us.
 learn how to create these automated au·to·mate  
v. au·to·mat·ed, au·to·mat·ing, au·to·mates

v.tr.
1. To convert to automatic operation: automate a factory.

2.
 messages.

GET IT LIVE

In prior issues of the JofA, Philip Philip, tetrarch of Ituraea
Philip, d. A.D. 34, tetrarch of Ituraea, son of Herod the Great. He was perhaps the ablest of the Herod dynasty. He is mentioned in the Gospel of St. Luke.
 Haase ("Spreadsheet, Meet Database; Database, Meet Spreadsheet," JofA, Dec.99, page 33) detailed how to link Excel to an Access database with a database query, and Jon Woodroof ("How to Link to Web Data," JofA, Mar. 99, page 55) demonstrated how to use Excel to retrieve live data from the Internet with Web Queries. Readers can refer to these articles.

In this article we will follow the directions in the above articles to link one Excel worksheet to a database and one to a Web site. We then will use the linked worksheets to develop and send automated e-mail messages.

There is one critical change to the linking processes described in earlier JofA articles. The latest edition of Excel (2000) allows you to set the refresh rate The number of times per second that a device, such as a display screen or DRAM chip, is re-energized. See vertical scan frequency and dynamic RAM.

(hardware) refresh rate
 (the timing intervals of the updates) to query either a Web site or a database. Excel 97 did not do that.

Before designing an automated e-mail system, let's review the basic process of linking Excel to the Web, which is described more fully in "How to Link to Web Data." First, create an Excel file with two worksheets. Call one worksheet Trading Stock, (exhibit 1, at right)--this will track securities prices (in this case Oracle and Cisco) and make any desired calculations--and name the other WebQuery. Then set up the cells as shown in the exhibit.

[ILLUSTRATION OMITTED]

In the Trading Stock worksheet, in cell C5, under the Market column, type =WebQuery!D4; the data collected in cell D4 in the Web Query worksheet will be copied into cell C5, as shown in exhibit 1. Copy this formula, with the appropriate cell reference changes, into the Market column cell for each stock you will monitor and fill in the Stock Symbol column. Now you can create a Web Query to fetch current market prices for your portfolio.

To create the query, place your cursor (1) The symbol used to point to some element on screen. On Windows, Mac and other graphics-based screens, it is also called a "pointer," and it changes shape as it is moved with the mouse into different areas of the application.  in cell A1 of the WebQuery sheet (exhibit 2, below) and click on the Data button on the toolbar A row or column of on-screen buttons used to activate functions in the application. Many toolbars are customizable, letting you add and delete buttons as required. Toolbars may be fixed in position or may float, which means they can be dragged to a more convenient location in the . Now click on Get External Data and then Run Saved Query (at this point you may also create a new Web Query by clicking on New Web Query). Now select a saved query and click on Get Data. We selected the saved query, which is called Microsoft Investor Stock Quotes.

[ILLUSTRATION OMITTED]

In the Woodroof article, the author selected a different saved query (Multiple Stock Quotes by PC Quote, Inc. at http:// webservices.pcquote.com/cgi-bin/ excel.exe). We chose the Microsoft query because the query by PC Quote is not provided with new versions of Microsoft Office Microsoft's primary desktop applications for Windows and Mac. Depending on the package, it includes some combination of Word, Excel, PowerPoint, Access and Outlook along with various Internet and other utilities. .

Click on Get Data to evoke e·voke  
tr.v. e·voked, e·vok·ing, e·vokes
1. To summon or call forth: actions that evoked our mistrust.

2.
 an external data dialog box A movable window that is displayed on screen in response to the user selecting a menu option. It provides the current status and available options for a particular feature in the program. . Click on the Properties button (exhibit 3, at right) and go to the Properties Dialog Box. Set your refresh rate at 30 minutes (or any appropriate time interval) and your Excel worksheet will regularly update with new data from the Internet (exhibit 4, at right). The same dialog box will appear after you create a database query, and you can set the refresh rate for those queries the same way. Click on OK after you have set the refresh rate and you will be returned to the external data dialog box (exhibit 3).

[ILLUSTRATIONS OMITTED]

Next, click on Parameters and choose Get the value from the following cell." (exhibit 5, at right). Click on the square icon on the right side of the textbox and highlight the range of cells that contains the stock symbols on the Trading Stock worksheet. Press Enter and click on OK. At this point, Excel will monitor the changes that occur every time a query is refreshed re·fresh  
v. re·freshed, re·fresh·ing, re·fresh·es

v.tr.
1. To revive with or as if with rest, food, or drink; give new vigor or spirit to.

2.
 and can send automated e-mails for any events that you specify.

[ILLUSTRATION OMITTED]

GOING ON AUTOMATIC

Now you're ready to create automated e-mails for the Excel file that's linked to live Web data. Of course, you're not limited to stock prices; you can link Excel to any compatible site.

The next step requires you to create some Visual Basic (VB) code. For convenience, you can download To receive a file transmitted over a network. In any communications session, "download" means receive, and "upload" means send. The download/upload often implies a big/little scenario, in which data is being downloaded from the "big" server into the "little" user's computer.  the complete code from http://www.bus.utk.edu/ Acct/rose/jofa.html and easily adapt it for other uses. Our code and examples assume the use of Excel 2000 and Outlook Express 5.0.

To begin, open the Trading Stock worksheet that now contains imported Web data. Excel will use the imported data to monitor changes and determine when to send an e-mail. In this example, we will monitor the price of Oracle stock and generate an alert when the stock falls below a specific price. You can generate emails based on any criteria you specify.

Click on Tools, Macro and then Visual Basic Editor (exhibit 6, at right).

[ILLUSTRATION OMITTED]

Next, double click on Sheet 1 (Trading Stock) in the Project-VBA Project screen, which is on the left side of the VB editor (exhibit 7, at right).

[ILLUSTRATION OMITTED]

This opens a window on the right side of the VB editor into which you will enter the automated e-mail code as a subroutine A group of instructions that perform a specific task. A large subroutine might be called a "module" or "procedure." Subroutine is somewhat of a dated term, but it is still quite valid.  called Private Sub Worksheet_Calculate(). The complete code is presented and described in exhibit 8, page 37). The Private Sub Worksheet_Calculate() statement can be used regardless of the type of data Excel retrieves or the criteria that you establish for generating email messages.
TECHNOLOGY WORKSHOP

Exhibit 8

This code creates a routine that executes      Private Sub Worksheet
whenever any values are calculated on your     Calculate()
Excel sheet.

This code establishes the criteria used to     price = Range ("C5")
generate an e-mail message. In this example,   Value If price < 30 Then
the e-mail will be sent only if the value in
cell C5 falls below 30. Otherwise, no e-mail
is generated. For different messages based
on different criteria you can substitute any
cell locations for cells B5 and C5 or add as
many more cell references as necessary.

This code creates the variables needed to      Dim Address As String,
generate an e-mail address, subject and        Subject As String
message.                                       Dim Body As String,
                                               Hyper As String

This code sets the e-mail address and          Address =
defines the subject of the e-mail message.     jakerose@utk.edu
You can create any subject you wish. All you   Subject = "Excel
need to do to create new messages or new       automated e-mail"
recipients is to set new values for the
Address, Subject and/or Body variables. For
example, to send this message to Anna Rose
instead of Jake Rose, change address =
"jakerose@utk.edu" to address =
amrose@utk.edu

This code creates the message. In this         Body = "The price of" &
example, the message tells you the new price   Range ("B5") & "has
of Oracle stock. The & symbol is used to       changed to:" & Format
combine pieces of text and cell references.    (Range ("C5"). Value,
All cell references follow the format          "$ #,###.#0") & "."
Range("cell address"). The Format command
creates a standard format for the
presentation of currency values. If your
criteria are not based on currency, you can
eliminate the Format command.

Defining the Hyper variable creates a          Hyper = "mailto:" &
hyperlink. The FollowHyperlink (Hyper)         Address & "?subject="
command activates the e-mail hyperlink,        & Subject "&body=" & Body
opens your e-mail browser and creates the      ActiveWorkbook.
message. This code uses the Hyper variable     FollowHyperlink (Hyper)
to create the e-mail message.

This code allows the system to wait a few      Application.Wait [Now +
seconds while the e-mail program opens and     TimeValue ("0:00:15")]
the message is generated. You can adjust the   Application.SendKeys "%s"
waiting period if necessary. The SendKeys
"%s" command simulates pressing Alt-S, which
is the keyboard shortcut for clicking on
Send in Microsoft Outlook Express.

The End If code ends the If statement          End If
and the End Sub code ends the routine.         End Sub


REPEATED MESSAGES

One potential limitation of the code is the way it handles repeated messages. For example, if your sheet is refreshed every 30 minutes and the price of Oracle remains below $30 for the entire day, you'll receive the same message every time any cell value changes.

While constant feedback is useful in some cases, you may wish to receive only a few notifications each day. To do this, you can reduce the query refresh rate or change your VB code so it sends only one message for a given change.

To change the VB code, double click on This Workbook work·book  
n.
1. A booklet containing problems and exercises that a student may work directly on the pages.

2. A manual containing operating instructions, as for an appliance or machine.

3.
 (exhibit 9, at right).

[ILLUSTRATION OMITTED]

Then type the following:
Private Sub Workbook_Open()
Range("15").Select
ActiveCell.FormulaR1C1 = "MAIL"
End Sub


The code creates a subroutine that runs every time your Excel workbook is opened. The subroutine types the word "MAIL" in cell I5. Use this field to tell Excel that it should send an e-mail if the price of Oracle stock meets your criteria (that is, if it falls below $30). Now update your code in the Worksheet_Calculate subroutine. Double-click on the Trading Stock worksheet in your VB editor and enter the changes to the e-mail code that appear in red in exhibit 10, page 41.
Exhibit 10

(Code changes are indicated in red type)

Private Sub Worksheet Calculate()

control1 = Range("15").Value

price = Range("C5").Value
If price [is less than] 30 And control1 = "MAIL" Then

Dim Address As String, Subject As String
Dim Body As String, Hyper As String

Address = "jakerose@utk.edu"
Subject = "Excel automated e-mail"
Body = "The price of" & Range("B5") & "has changed to:" &
Format(Range("C5").Value, "$ #,###.#0") & "."

Hyper = "mailto:" & Address & "?subject=" & Subject &
"&body=" & Body

ActiveWorkbook.FollowHyperlink (Hyper)

Application.Wait (Now + TimeValue("0:00:15"))
Application.SendKeys "%s"

Range("15").Select
ActiveCelI.FormulaR1C1 = "STOPMAIL"

End If
End Sub


The additional code serves two purposes. First, adding And control1="MAIL" to the If statement tells Excel that it should send an e-mail only if cell I5 contains the word MAIL. The range statement
Range("15").Select
ActiveCell.FormulaR1C1 = "STOPMAIL"


changes the text in cell I5 to read "STOPMAIL." If the price of Oracle remains below $30 the next time the worksheet updates, no additional e-mail messages will be sent.

WORK WITH A DATABASE

The code described above can generate e-mails based on data imported from a database rather than from the Web with just a few changes. First, link an Excel worksheet to an Access database. To create a database query, follow the procedures described in "Spreadsheet, Meet Database; Database, Meet Spreadsheet." You can link Excel to many different types of database products.

Once linked, open the Excel sheet that contains the database query. Once again, you will click on Tools, then Macro and then Visual Basic Editor. Double-click on the sheet that contains your database query in the Project Screen (just as you did for the Web Query in exhibit 7). The code described above for sheets linked to Web sites remains essentially the same. The only necessary changes are to the criteria used to generate messages and the message itself.

Assume, for example, that your company tracks inventory levels in a real time database and you have linked your Excel sheet to that database. Further assume that you want to receive a message whenever the quantity of Item Number 104 falls below 100 (the reorder point 1. That point at which time a stock replenishment requisition would be submitted to maintain the predetermined or calculated stockage objective.
2. The sum of the safety level of supply plus the level for order and shipping time equals the reorder point. See also level of supply.
). To modify the prior code, replace the price variable definition used in the Web Query example with the following new variables: quantity1 = Range ("H5"). Value (assuming the quantity of Item Number 104 is found in cell H5).

Now replace the old criteria with a new If-Then statement: If quantity1 [is less than] 100 Then. The only other change needed is to the message itself. To create the message body, redefine Verb 1. redefine - give a new or different definition to; "She redefined his duties"
define, delimit, delimitate, delineate, specify - determine the essential quality of

2.
 the body variable: Body = "The stock of" & Range("G5") & "has fallen to:" & Range("H5") & ".". If the quantity of Item Number 104 falls to 89, you will receive a message that states, "The stock of Item Number 104 has fallen to 89." As with Web queries, you can monitor multiple variables with multiple If-Then statements, and you can limit the number of messages using the methods that are described above.

To activate your database monitor and automated e-mail system, open the Excel workbook that contains your database query and VB code. You can travel with confidence, knowing that your database monitor is constantly watching out for your interests. There are vast opportunities to use Excel as a monitoring device. With a little creativity, you can alter the queries and codes to create many different automated systems.

Key to Instructions

To help readers follow the instructions in this article, we use two different typefaces This is a list of typefaces. Serif
Here you can find a graphical version of this table.
  • Aldus
  • Antiqua
  • Aster
  • Baskerville
  • Bell (Monotype) Didone classification serif type deisgned by Richard Austin, 1788
  • Bembo
  • Benguiat
.

Boldface See boldface font.  type is used to identify the names of icons, agendas and URLs.

Sans serif Short horizontal lines added to the tops and bottoms of traditional typefaces, such as Times Roman. Contrast with sans-serif.

 type indicates commands and instructions that users should type into the computer and the names of files.

An Invitation

If you have a special how-to technology topic you would like the JofA to consider for inclusion in this series, or an application shortcut (1) In Windows, a shortcut is an icon that points to a program or data file. Shortcuts can be placed on the desktop or stored in other folders, and double clicking a shortcut is the same as double clicking the original file.  you devised and would like to share with other professionals, contact Senior Editor Stanley Stanley, town (1991 pop. 1,557), capital of the Falkland Islands, S Atlantic Ocean, on East Falkland island. It is the main port and trading center of the islands. The name is sometimes written as Port Stanley.  Zarowin. His e-mail address See Internet address.

e-mail address - electronic mail address
 is zarowin@mindspring.com.

ANNA M. ROSE, CPA (Computer Press Association, Landing, NJ) An earlier membership organization founded in 1983 that promoted excellence in computer journalism. Its annual awards honored outstanding examples in print, broadcast and electronic media. The CPA disbanded in 2000. , PhD, and JACOB Jacob (jā`kəb), in the Bible, ancestor of the Hebrews, the younger of Isaac and Rebecca's twin sons; the older was Esau. In exchange for a bowl of lentil soup, Jacob obtained Esau's birthright and, with his mother's help, received the blessing  M. ROSE, PhD, are assistant professors of accounting at the University of Tennessee The University of Tennessee (UT), sometimes called the University of Tennessee at Knoxville (UT Knoxville or UTK), is the flagship institution of the statewide land-grant University of Tennessee public university system in the American state of Tennessee. , Knoxville. Their e-mail addresses are amrose@utk.edu and jakerose @utk.edu.
COPYRIGHT 2001 American Institute of CPA's
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 2001, Gale Group. All rights reserved. Gale Group is a Thomson Corporation Company.

 Reader Opinion

Title:

Comment:



 

Article Details
Printer friendly Cite/link Email Feedback
Title Annotation:how to use Microsoft Excel software to search for data; e-mail
Author:Rose, Jacob M.
Publication:Journal of Accountancy
Article Type:Product/Service Evaluation
Geographic Code:1USA
Date:Apr 1, 2001
Words:2592
Previous Article:Facing the future.(accounting firms and the future of computers)
Next Article:Be a standout on the Web.(marketing CPA services on the Internet)
Topics:



Related Articles
Electronic business tool. (spreadsheet software) (includes an article on personal information management systems) (Buyers Guide)
Spreadsheets: faster, smarter.
The power of spreadsheets. (software programs)
Add perspective to spreadsheets.(information analysis by CPAs using spreadsheet software)
Palm Users Now Able To E-Mail Spreadsheet Attachments With Automatic Conversion.(Company Business and Marketing)(Brief Article)
Software To Scratch Palm's Itchy Niches.(Software Review)(Evaluation)
Make your mark in spreadsheets.(using Excel software tools in auditing)
Show-and-tell in real time: link a spreadsheet to a PowerPoint slide for up-to-the-minute visuals.
Data management.(technology Tools)(spreadsheet management software)
Taming the cells: automated spreadsheet control can help insurers breeze through regulatory compliance standards.

Terms of use | Copyright © 2010 Farlex, Inc. | Feedback | For webmasters | Submit articles