You are on page 1of 17

Essential Excel tips

50 essential Excel tips


Your users can save a lot of time and effort working with Excel if they know a few tricks and shortcuts.
These valuable tips originally appeared in our Excel e-newsletter, which has now been beefed up to
include productivity tips for the entire Microsoft ffice suite. To begin receiving this free, valuable resource
every !ednesday, visit our e-newsletter subscription center.
Table of contents
Easy data-posting to the !eb........................................................................."
pen !eb pages right in Excel......................................................................"
#etect $nd %epair..........................................................................................."
&ser-level prevention is a magic cure.............................................................'
pening multiple windows..............................................................................'
(reating custom lists...................................................................................... '
(opying styles between workbooks................................................................)
$ macro that pulls source data from charts.....................................................)
&pdate for Excel *+++ text export...................................................................)
(reating a workspace in Excel........................................................................)
,rinting formulas.............................................................................................-
.hifting a scatter chart/s axis..........................................................................-
%ecovering data with the .Y01 format...........................................................-
2aster access to worksheets..........................................................................3
4nserting the full file path in headers and footers.............................................3
Exceeding the "+-argument limit....................................................................3
$sk Mr. Excel.................................................................................................. 3
(atching data entry errors..............................................................................3
5uickly setting a print area.............................................................................6
(ounting the days via cell subtraction.............................................................6
5uickly shuffling toolbar buttons.....................................................................6
pening a workbook at startup.......................................................................6
7iding duplicate records.................................................................................6
(onverting 8ulian dates..................................................................................9
.aving time with (ustom :iews......................................................................9
;eware of sharing dates between Excel for !indows and Excel for Macs.....9
,age <
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
#on/t use $uto2ormat on an entire worksheet..............................................<+
1eep track of changes..................................................................................<+
(onditional formatting...................................................................................<+
#ata entry solutions with the Template !iAard..............................................<<
(ustomiAing Bdivision by +B error messages.................................................<<
#ebugging your code....................................................................................<<
#ebugging using watches.............................................................................<*
Ensure proper data entry with validation.......................................................<*
7yperlink to a specific cell.............................................................................<*
Macro security settings.................................................................................<"
Express yourself with comments..................................................................<"
Map your dataCon real maps.......................................................................<"
(reate an utlook message from Excel.......................................................<"
%epairing broken file type associations.........................................................<'
!eb ,ublishing !iAard Error with ffice *+++.............................................<'
&se auditing to troubleshoot.........................................................................<)
&sing Doal .eek........................................................................................... <)
&sing shared workbooks..............................................................................<)
&se the 4mmediate window...........................................................................<)
.ummariAe data with grouping.....................................................................<-
Take a few shortcuts.....................................................................................<-
$nalyAing external data in Excel...................................................................<3
Take advantage of the ,ersonal Macro !orkbook........................................<3
(lear out all comments.................................................................................<3
,age *
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
Easy data-posting to the Web
4f your organiAation is using an intranet to share public dataCand whose organiAation isn/t these daysC
your users will want an easy way to post this information. Excel 93 offers an easy, wiAard-driven system to
walk even the most apprehensive users through this process?
<. .elect the cell range that contains the data to be published.
*. .elect .ave $s 7TM0 from the 2ile menu.
". $nswer the Euestions posed by the 4nternet $ssistant !iAard.
The wiAard walks users through four steps that define how information will be converted for !eb
display. :arious options include?
4nserting the resulting 7TM0 tables into an existing 7TM0 page or creating an entirely new page.
.pecifying formatting options, such as rules between data.
.aving the new 7TM0 page as a freestanding file or inserting it directly into a 2ront,age !eb.
Open Web pages right in Excel
4f your users need to analyAe data found on a !eb site, they might be in for a bunch of tedious retyping.
&nder the right circumstances, however, Excel 93 can save them a lot of time by letting them open an
7TM0 page in Excel directly from the !eb.
The procedure is Fust a slight modification of the standard file-opening procedure?
<. (hoose pen from the 2ile menu.
*. 4n the 2ile >ame text box, type the &%0 of the !eb file to open. >ote? ;e sure to include the prefix
http?@@.
". 2rom the 2iles f Type drop-down list, select 7TM0 #ocuments GH.html, H.htmI.
'. (lick pen.
Excel opens 7TM0 pages based on the 7TM0 table structure of the page, so some !eb design
treatments may lead to some weird results in Excel. 2or pages that cleanly present data in a table format,
however, this approach can be a real time-saver.
Detect And Repair
Microsoft ffice *+++ programs, including Excel, contain a command line called #etect $nd %epair, which
checks and fixes problems with ffice program files, #00s, and registry settings. GThis utility does not
affect worksheets or other document files.I
#etect $nd %epair, which you access as a command line option of the .etup utility, performs the following
actions?
%einstalls ffice .exe and .dll files if missing, out-of-date, or corrupt
%einstalls all !indows 4nstaller shortcuts, overwriting any existing shortcuts
%ewrites all reEuired local machine registry values
%ewrites all reEuired user registry values
You can run #etect $nd %epair from within ffice, but that won/t do much good if a serious error is
preventing your user from even launching an ffice application. 2ortunately, you can run the utility from
the %un dialog box with the following entry?
drive:\setup.exe /focums install.msi
,age "
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
User-level prevention is a agic c!re
Every support pro knows that most of their problems could be avoided if their users would Fust follow a
few simple, common sense precautions. 4f you keep getting calls on corrupted Excel documents, pass
around this list of Microsoft-endorsed tips to help users keep their data safe and make your days a little
less stressful?
Move radios, fax machines, televisions, stereos, speakers, and other sources of electromagnetic
radiation away from computers.
4f your users are still using floppies, make sure they are not putting them on top of their monitors.
%egularly run >orton $nti:irus or another utility to scan for viruses.
.tore floppy disks in a disk storage container.
#on/t be a slobCprevent dust from building up around your computer.
$nd, most important, exit !indows before restarting or shutting down a client system.
Opening !ltiple "indo"s
ne of the most frustrating problems for Excel users is viewing all the information they need, especially
because it often lives in different worksheets. 0et your users know about this simple way to view multiple
sheets, and they/ll love you forever.
<. (lick on the tab of the worksheet you want to view.
*. (hoose >ew !indow from the !indow menu.
". %epeat this process for each of the worksheets you want to display. GExcel opens each sheet in a
window that sits on top of the previous one.I
'. To see them all at one time, choose $rrange from the !indow menu.
). .elect Tiled, 7oriAontal, or :ertical.
-. .elect the !indows f $ctive !orkbook check box.
3. (lick 1.
#reating c!sto lists
7ere/s another timesaving tip to pass on to your users. 4f they often make use of the same lists of data,
you can teach them to create a custom list instead of typing the same information repeatedly.
2or all versions of Excel, if the data is already in a worksheet, follow these steps?
<. .elect all of the cells containing the information you want to copy.
*. .elect ptions from the Tools menu.
". (lick the (ustom 0ists tab.
'. (lick 4mport.
4f you want to create a list from scratch in Excel 93, follow these steps?
<. Do to the Tools menu and choose (ustom 0ists.
*. (lick in the 0ist Entries box.
". Type each item for your list, pressing JEnterK after each item.
'. !hen you/re finished, click 1 to create the list.
To create a list from scratch in Excel *+++@L,, follow these steps?
<. .elect ptions from the Tools menu.
*. (lick the (ustom 0ists tab.
". Type each item in the 0ist Entries box, pressing JEnterK after each one.
'. (lick $dd.
To use a custom list, type the first entry of the list. &se the fill handle at the bottom right corner of the
cell to drag the whole list across adFacent cells.
,age '
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
#opying styles bet"een "or$boo$s
(reating formatting styles is a real timesaving trick for users. .o why should they waste time re-creating
these styles in multiple workbooksM 4f they have formatted a workbook in a particularly useful way and
want to continue to use the format in other workbooks, teach them how to copy the style from one
workbook to another?
<. pen the source workbook and the destination workbook.
*. Make sure that the destination workbook is active, go to the 2ormat menu, and choose .tyle.
". (lick the Merge button.
'. !ithin the Merge .tyles dialog box, select the source workbook from the Merge .tyles 2rom list box.
). (lick 1.
A acro that p!lls so!rce data fro charts
!hen building charts in Excel 93, many users reference information in other workbooks to keep
spreadsheets fairly streamlined. ;ut what do you do if a user complains that the data source has become
corrupted or that the file is no longer available in the networkM
4t/s a little bit of a headache to read, but 1nowledge ;ase article <"3+<- includes the full contents of a
macro that can strip important data from the graphic elements of a chart.
http?@@support.microsoft.com@support@kb@$%T4(0E.@5<"3@+@<-.asp
$fter creating the simple :;$ macro, you only need to run it and drop the information into a worksheet
called (hart#ata. #on/t go volunteering this information to all of your users, but if a :, loses an important
sales worksheet, you can pull out this nifty power trick and save the day.
Update for Excel %000 text export
Microsoft has released a patch that fixes a formatting problem when exporting Excel *+++ files to .txt
documents. n machines running a Microsoft . earlier than !indows *+++, four-digit year entries are
automatically truncated to two-digit entries, regardless of formatting applied within Excel.
This behavior occurs only when users employ a macro or procedure to export to a text file, not during
manual saves to a text file format. 4f your users are using :isual ;asic for $pplications to export files to
.txt, .prn, .csv, or .dif formats Gand you are using a pre-!indows *+++ .I, you need to install an update
released by Microsoft. 2or more information, read the Microsoft 1nowledge ;ase article *'339-, L0*+++?
,rogrammatically Exporting Text 2ile Truncates #ates?
http?@@support.microsoft.com@support@kb@articles@5*'3@3@9-.asp
#reating a "or$space in Excel
ften, your users will be working with several workbooks at a time. They will be happy to know that they
can arrange the workbooks, save them as a workspace, and then open everything at once in the viewing
configuration they prefer. 7ere/s how?
<. !ith all the workbooks in the preferred positions, go to the 2ile menu.
*. (hoose .ave !orkspace.
". Type a name for the file.
'. (lick .ave.
The next time your users want to work with those workbooks, they can go to 2ile N pen and select their
workspace.
,age )
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
&rinting for!las
4f your users have invested time in writing numerous formulas, they may want to print them for
safekeeping. $lthough Excel doesn/t include a simple B,rint 2ormulasB button, functionality is built in.
7ere/s how to find it?
<. Do to the Tools menu.
*. (lick ptions.
". !ithin the section called !indow ptions on the :iew tab, select 2ormulas.
'. (lick 1.
There is also a keyboard shortcut for this function. ,ress J(trlKO. 4n both cases, the result is that the
formulas, rather than their results, will appear in the worksheet.
'hifting a scatter chart(s axis
4n most cases, Excel/s default behavior of making the x-axis and y-axis of scatter charts intersect at + is
desirable. ;ut sometimes, your users may want to change that intersection point. $n obvious example is
when a user needs to highlight Fust a selected number of years of data but doesn/t want to create an
entirely new chart.
To reset an axis, follow these steps?
<. $ctivate the chart for editing.
*. (lick to select the axis you want to modify.
". (hoose .elected $xis from the 2ormat menu.
'. .elect the .cale tab.
). Type a number in the :alue GL or YI $xis (rosses $t text box.
-. (lick 1.
Recovering data "ith the ')*+ forat
4f a user complains of being unable to save a workbook, the problem is usually user error. 7owever,
things do go wrong. 4f you/ve tried all the common sense remedies and the workbook does seem to be
corrupted, you can try to revert to the old .ymbolic 0ink G.Y01I format.
This approach will let your users recover most of their essential data by stripping away the more
complex information that tends to be the source of corruption. &nfortunately, this trick won/t help them get
back any data, including charts and graphics, that wasn/t supported back in the days of Excel *.+.
2ollow these easy steps in Excel 93?
<. pen the file that appears to be corrupted.
*. .elect .ave $s from the 2ile menu.
". 4n the .ave $s Type list, select .Y01 G.ymbolic 0inkI.
'. (lick .ave.
). (lick 1 in the warning dialog box that appears when you save in .Y01 format.
-. (lose the file.
3. (lick >o to move on past the warning that the file you are closing is not in the normal Microsoft Excel
format. G(licking Yes will resave the file in the normal Microsoft Excel format.I
6. .elect pen from the 2ile menu.
9. .elect $ll 2iles GH.HI in the 2iles f Type drop-down list.
<+. .elect the .Y01 file you saved in step " and click pen.
<<. .elect .ave $s from the 2ile menu.
<*. .elect Microsoft Excel !orkbook GH.xlsI in the .ave $s Type drop-down list.
<". (lick .ave.
2or additional information, check out Microsoft 1nowledge ;ase article ')))3?
http?@@support.microsoft.com@support@kb@$%T4(0E.@5')@)@)3.asp
,age -
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
,aster access to "or$sheets
!hen working with large workbooks in which all of the worksheet tabs are not visible, your users may get
frustrated with scrolling to find the sheet they need. 7ere/s a really Euick tip to pass on. %ight-click on any
of the tab-scrolling buttons Gto the left of the sheet tabsI and a shortcut menu will pop up. You can then
select the tab you want.
-nserting the f!ll file path in headers and footers
Excel 93 doesn/t offer you the option of displaying the full file path in worksheet headers and footers. !ith
a little basic :;$ editing, you can add this functionality to users/ systems.
<. Do to Tools N Macro N :isual ;asic Editor.
*. Do to the :iew menu and select (ode.
". Type the following?
Sub PathFooter()
ActiveSheet.PageSetup
eftFooter!Active"or#boo#
Full$ame
%nd sub
'. Do to 2ile N (lose.
%eturn to your workbook and save the file. You can now run your macro by navigating to Macros and
choosing the one named ,ath2ooter.
Exceeding the .0-arg!ent liit
Excel has a "+-argument limit for statistical functions. 4t/s easy to get around, though, if you group some
of your arguments within parentheses.
4nstead of entering $:DG$<,$*,$"P,$""I, you can enter $:DGG$<,$*,$"I$'P,$""I, and Excel will
accept the grouped arguments as a single argument within the formula.
As$ /r0 Excel
Excel power users and support pros? (heck out MrExcel.com. Mr. Excel answers one reader/s Euestion
per week, according to what piEues his interest, often including full macros to be copied and put to use.
;ecause this is a side proFect for the site/s operator, he can/t answer every Euestion submitted, but he
has provided a message board for other Excel users to exchange information. ther site features include
past week/s tips, Euick answers, book reviews, and the opportunity to find out whether you can answer
the monthly challenge.
4f you work extensively with Excel and :isual ;asic, this may be the one resource you/ve been looking
for.
http?@@www.mrexcel.com
#atching data entry errors
4t/s a fact? .hared workbooks generate more errors than workbooks with only one owner. 7ere/s one way
to flag errors as they occur?
<. .elect all cells in which data will be entered.
*. Do to 2ormat N (onditional 2ormatting.
". 4n the (onditional 2ormatting dialog box, specify which cell values to flag.
'. (lick 2ormat.
). 4n the 2ormat (ells dialog box, click the ,atterns tab and select a color to signal errors.
-. (lick 1.
>ow, when someone enters an error, it will be flagged with your selected color.
,age 3
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
1!ic$ly setting a print area
Your users probably waste a lot of time and paper sending entire worksheets to the printer when all they
need is a printout of a few columns or rows. Teach them this Euick trick to set specific print areas within
the ,rint ,review mode?
<. .elect :iew N ,age ;reak ,review.
*. .elect the cells you want to print.
". %ight-click on the selection and choose .et ,rint $rea from the shortcut menu.
'. (lick ,rint.
#o!nting the days via cell s!btraction
;y default, Excel 93 adFusts the display of dates to friendly displays that users can identify. ;ut behind the
scenes, Excel still thinks in numbers. .o finding the number of days between two days is as easy as
simply subtracting one cell that contains a date, regardless of format, from another date-carrying cell.
2or example, let/s suppose a user has entered the date *@*+@*+++ in cell $< and "@<+@*+++ in cell $*.
The formula $*-$< will return the result <9 G*+++ was a leap yearI. >ote? You must use the date that falls
later in the calendar year as the first argument of the eEuation, or the eEuation will return an error.
;y default, Excel will format the result of a formula in the same format as the source cells. .o in our
example, it reports that the difference between *@*+@*+++ and "@<+@*+++ is <@<9@<9++. 7owever, simply
right-clicking the formula cell, selecting 2ormat (ells, and selecting a >umber format will fix this problem.
1!ic$ly sh!ffling toolbar b!ttons
7ere/s a Euick tip you can pass on to your users who like to modify their Excel toolbars.
4nstead of right-clicking a toolbar and selecting (ustomiAe to launch the (ustomiAe dialog box, they can
simply press the J$ltK key and click and drag a button to any toolbar they want. f course, both the source
and target toolbars must be visible for this procedure to be effective.
ne Euick word of warning? This techniEue moves buttons, so they will no longer be on the default
toolbar. 4f users want to copy a button to a new toolbar while retaining its position on the original one, they
can hold down J(trlKJ$ltK while clicking and dragging the button.
Opening a "or$boo$ at start!p
4f some of your users spend much of their day working in a specific workbook, you can teach them how to
designate that workbook to open each time Excel launches. $ll they need to do is place the workbook Gor
a shortcut to the workbookI in the L0.tart folder. This techniEue also works with network shortcuts.
You/ll find the L0.tart folder in the same place as the Excel program filesCtypically (?Q,rogram
2ilesQMicrosoft fficeQffice. $fter placing the file or shortcut in the L0.tart folder, the user can Fust restart
Excel to see the file pop open automatically.
2iding d!plicate records
ne of the most common mistakes users make in preparing a report or sorting data is including
redundant entries. 2or example, if a worksheet keeps a running tally of purchases made by (ustomer <,
there/s no need to report cells other than the ones keeping the composite figures. $ built-in filter in Excel
will take care of this problem.
2ollow these steps?
<. (hoose #ata N 2ilter N $dvanced 2ilter.
*. #rag across the worksheet to select the lists containing duplicate entries.
". .elect &niEue %ecords nly.
'. (lick 1.
Excel will now hide any duplicate records in the selected range.
,age 6
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
#onverting 3!lian dates
7ere/s a little piece of post-Y*1 calendar trivia for you. .ince the <9)+s, astronomers and geophysicists
have used 8ulian dates to track time in continuous, absolute terms, without bothersome seasons, leap
years, or man-made conventions. 8ulian dates associate a date with the number of days elapsed since
8anuary < of the same year. G2or example, 8an. *, *+++, has the value of *.I
Excel doesn/t have a built-in option to convert dates to 8ulian time, but you can use this shortcut to
convert today/s date to the 8ulian format?
8ust type this eEuation into any cell in your worksheet?
!&A'%(()*+,(-%A((,./A-())01)2,%3,(,./A-()4/A,%(-%A((,./A-())45051065)078887))
>ow, you/ll need to format this value to display five digits.
<. %ight-click in the cell that contains the value and select 2ormat (ells.
*. n the >umber tab, choose (ustom from the (ategory list box.
". 4n the Type text box, enter 00000.
'. (lick 1.
'aving tie "ith #!sto 4ie"s
(ustom :iews is a tool in Excel that lets you assign a name to a particular sheet layout so you can recall
it for later viewing. You can access the feature by selecting :iew N (ustom :iews. 4n the (ustom :iews
dialog box, you/ll see a listing of saved views, and you can add or delete views. !hen adding a view, you
have the option of including print settings, hidden rows and columns, and filter settings. The new view
even remembers where the active cell was when the view was saved, so when you open that view, it will
RFumpR to the spot in your sheet that corresponds to that view.
Making good use of custom views can save a great deal of time. 2or example, you can eliminate
repetitive hiding, resiAing, filtering, and other changes for producing various printed reports. Each set of
options can be saved as a view. Then, all you need to do is apply the view before you print.
5e"are of sharing dates bet"een Excel for Windo"s and Excel for /acs
Excel supports two data systems? <9++ and <9+'. Early Macintoshes did not support dates before 8an. <,
<9+'. 2or this reason, Excel for Macs renders entered dates as the number of days since <@<@<9+'. Excel
for !indows, on the other hand, supports dates starting 8an. <, <9++, and so renders dates as the
number of days since <@<@<9++.
2or example, the date <@<@<9+' is represented as a + in the <9+' date system. The same date in the
<9++ date system is represented by the number <,'-*. This is because <@<@<9+' is <,'-* days since
<@<@<9++, the day the <9++ date system begins its Bcounting.B
!hat all this means to you is that if you have users on both Macs and ,(s using Excel and copying
data between workbooks, there/s the chance of incorrect date representation.
ne solution is to set your ,(s so that they all use the <9+' date system. Then they/ll be compatible
with the Macs. To do so, open a workbook and select Tools N ptions. (lick the (alculation tab. &nder
!orkbook ption, select the <9+' #ate .ystem check box and click 1. 2or more information, check out
Microsoft/s 1nowledge ;ase article *<'""+, which covers this issue in depth?
http?@@support.microsoft.com@support@kb@articles@5*<'@"@"+.asp
,age 9
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
Don(t !se A!to,orat on an entire "or$sheet
Microsoft has confirmed that there/s a potential problem when $uto2ormat is selected for a whole
worksheet rather than a specific range.
#epending on your . and configuration, you could see symptoms ranging from Excel not responding
to various error messages concerning page faults, low virtual memory, and access violations.
To resolve this issue, make sure that you select only the range of cells you want formatted when you
select 2ormat N $uto2ormat.
Microsoft 1nowledge ;ase article *<<'36 offers the details of the problem?
http?@@support.microsoft.com@support@kb@articles@5*<<@'@36.$.,
+eep trac$ of changes
Track (hanges works hand-in-hand with workbook sharing. 4t keeps a log of all changes to a workbook. 4t
tracks cell changes, worksheet additions and deletions, column changes, and other types of changes, as
well as the date, time, and name of the user who made the change. !hen data is changed, it keeps a
record of the old and new values and the exact sheet and cell where the edit was made.
ne of the best parts of this tool is the ability to have Excel make a list of the changes in a separate
worksheet. !hen this option is selected, Excel builds a listing of each change and even turns on
$uto2ilter to make finding specific changes easy. 4t also allows you to review each change and either
accept or reFect it. %eFecting a change restores the original value.
To turn on this tool, Fust select Tools N Track (hanges N 7ighlight (hanges. The 7ighlight (hanges
dialog box provides options such as tracking who makes the change, when the change is made,
highlighting the change on-screen, and listing the changes.
!hen using this feature, you might like to see the .ummary sheet when you open your workbook.
Excel removes it when you save the sheet, but you can use this macro to have Excel Euickly rebuild it?
Sub &ie9:hangeSummar;()
"ith Active"or#boo#
+ighlight:hanges.ptions "hen:!xlAll:hanges
ist:hanges.n$e9Sheet ! ,rue
+ighlight:hanges.nScreen ! ,rue
%nd "ith
%nd Sub
#onditional foratting
(onditional formatting is one of Excel/s better features. 4t allows you to preset certain font styles, colors,
and cell-background colors based on cell values. This can be very useful for highlighting important
information and values outside an accepted range or providing a visual cue to associate value ranges
with color codes.
The best part is that conditional formatting is easy to set up. 8ust click the cells you/d like to format and
select 2ormat N (onditional 2ormatting. The (onditional 2ormatting dialog box lets you set up the
conditions by which the formatting of the cell will occur. You pick the operator Gbetween, eEual to, less
than, etc.I and the value or range of values. (lick 2ormat to open the 2ormat (ells dialog box, where you
can select the colors and styles to be used.
Each cell can have several conditional formats. 2or example, you might say that if a certain cell/s value
is between *+ and )+, the text should be blue on a yellow background. ;ut you can format that same cell
to exhibit red, bolded text on a green background if it contains a value between )< and <++.
,age <+
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
Data entry sol!tions "ith the Teplate Wi6ard
ne of the hardest parts of gathering data from users is creating the right collection application. The data
collection front end is often a series of forms in $ccess or $., pages. 7owever, the setup and security
issues associated with these methods are sometimes too much to deal with for smaller data collection
needs.
Excel 93 and *+++ ship with an add-in that can help this situation. The Template !iAard with the #ata
Tracking add-in will help you create an Excel template that will accept data from users in a familiar
environment and then transfer the data to an $ccess database after it/s saved. The wiAard will walk you
through the steps of defining the tables where the data should be inserted.
This is a great solution for such things as purchase order reEuests, invoices, or expense forms. Your
users can enter their data in Excel, and the data structures set up by the !iAard will place that data into
the $ccess database. The data will be collected into one repository for easy reporting and analysis.
Microsoft 1nowledge ;ase article *<'*'- explains the process in detail?
http?@@support.microsoft.com@support@kb@articles@5*<'@*@'-.$.,
$ separate article explains how to use the wiAard with Excel 93?
http?@@support.microsoft.com@default.aspxMscidSkbTE>-&.T<'6"<'
Excel L, users don/t have to forgo this handy add-in, although it doesn/t ship with the program.
Microsoft has made the wiAard for Excel L, available for download.
#!stoi6ing 7division by 07 error essages
!orking in a complex worksheet, you may have encountered that annoying BU#4:@+VB error when the
divisor of your formula is a Aero. &sing the built-in 42 function, you can create your own message for
display when you divide by Aero?
!)F (/)&)S.( ! 807-our ,ext70 /)&)/%///)&)S.()
The 42 function evaluates the first parameter G#4:4.% S +I. 4f it/s T%&E, it places the second
parameter GBYour TextBI in the cell. 4f it/s 2$0.E, the function places the third parameter
G#4:4#E#@#4:4.%I in the cell.
This helps you control the message that/s displayed when your formula produces a Aero value that is
then used to divide another value.
Deb!gging yo!r code
$ great way to find errors in your code is to step through it one line at a time. The .tep 4nto button on the
#ebug toolbar in the :;$ Editor lets you do this.
To start your macro, Fust click .tep 4nto on the toolbar. The :;$ Editor will work through each
statement. This allows you to take advantage of some of the other debug tools, such as the 0ocals
window and the !atchwindow.
!hen stepping through your code, you can use the .tep ut command to run the remaining code as
normal. .o even if you stepped through half the macro one statement at a time, you can then run the last
half normally by clicking .tep ut.
,age <<
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
Deb!gging !sing "atches
You/ve Fust spent over an hour writing Fust the macro you need. 4t/s the one that will make your life easier,
and you Fust got it rightCor so you thought. ;ut now it/s providing the wrong data output, and you can/t
figure out why. $ll the code looks right.
ne of the great debug tools in the :;$ Editor is called a watch expression. !atch expressions allow
you to see the values of the variables in your macro at any given time. You can use them with the .tep
commands to walk though your code. These values can be a big help in finding out why your macro is
generating the wrong data. You can use the watch expressions to see your variable values and then
compare them to what they would be if your macro were working correctly.
To access the !atch window, Fust click :iew N !atch !indow in the :;$ Editor. To add a watch, right-
click a variable and select $dd !atch from the shortcut menu. This brings up a dialog box that gives you
options about the new watch.
Ens!re proper data entry "ith validation
#ata validation rules in Excel automatically check an entry made by a user against rules you have preset
in the worksheet. This is helpful when you have formulas that depend on certain expected input from the
user. These formulas can often return errors if the format of the entered data is wrong.
To set data validation rules, select #ata N :alidation. The dialog box allows you to pick a data type to
reEuire and a range of values to accept. 4n the 4nput Message tab, you can choose to display an
instructional message when the cell is selected. This message appears in a pop-up, note-style display. 4t
can be used to provide users with information about what data you expect them to enter. You can also
provide a message from the Error $lert tab if the data entered does not meet your rules.
#on/t assume that your users will enter the data you expect. 4f your worksheet functionality depends
upon consistent data entry, look into using data validation.
2yperlin$ to a specific cell
#id you know that you can create a hyperlink from a !eb page on your intranet or the 4nternet to a
particular sheet, range, and cell in an Excel workbookM 2or example?
<a href!7http://;our9ebserver/h;perlin#testing
.xls=Sheet5>A57?in# ,est </a?
will open your file called 7yperlinktesting.xls and then select cell $< on .heet<.
&sing this kind of linking, you can specify exactly where your user will enter the workbook. &sers/ views
of the workbook won/t be bound by the state at the last save.
This can be helpful if you insert the link to a !eb page that asks the user to enter data in a particular
cell or area of a sheet. You can select the cell for them when they click the link.
2or information on linking to Excel 93 worksheets, see Microsoft 1nowledge ;ase article <3*)+"?
http?@@support.microsoft.com@default.aspxMscidSkbTE>-&.T<3*)+"
2or details on linking to Excel *+++ worksheets, see Microsoft 1nowledge ;ase article *<<-9"?
http?@@support.microsoft.com@support@kb@articles@E*<<@-@9".asp
,age <*
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
/acro sec!rity settings
4f you write macros that other people in your organiAation use, you should be aware of the Macro .ecurity
settings in Excel Gand in all ffice applicationsI. These settings control the messages you receive when
you open a workbook that contains macrosT they ask if it/s okay to enable them.
4n the good old days, developers didn/t have to worry about such things. ;ut with the advent of macro
viruses, you now need to take such user-level security settings into account when developing code.
4n ffice *+++@L,, there are three levels of security for macros contained within files?
2igh automatically disables any macro not BsignedB with a digital signature. 4t will allow macros to
be enabled only from sources already deemed to be Btrusted.B
/edi! prompts users to decide whether a macro should be enabled.
*o" does not notify users that files contain macros. $ll macros are enabled for opened files.
The security settings on your users/ machines might be dictated by policy or may be up to the user/s
discretion. Either way, the safest action for developers of ffice-based macros is to obtain a digital
signature to sign their macros. !ith a digitally signed macro, even the 7igh setting will enable your code,
provided the user approves.
Express yo!rself "ith coents
!e/ve all opened the workbook from hell. The formatting was a mess, and there were formulas
everywhere. $ day later, you may almost have it decoded enough to work on it.
Det your users into the habit of documenting workbooks with comments. They can enter text
descriptions into any cell. These descriptions are visible only if you hover the mouse over the cell. $ cell
with a comment is marked with a small red triangle in the upper-right corner. Your users can easily add a
comment to a cell by clicking 4nsert N (omment.
Excel/s %eviewing toolbar facilitates working with the comments in a workbook. The options on this
toolbar allow users to add and delete comments and move from one comment to another in a workbook.
!ith the growing use of teams and collaboration, it/s more important than ever to ensure that your
users/ intentions are clearly communicated to everyone who needs to use a workbook. (omments are a
good way to start.
/ap yo!r data8on real aps
4f you often analyAe geographically based data in Excel, you should check out Microsoft Map,oint *+++.
Map,oint lets you create customiAed maps, and you can arrange your data on a map to suit your needs.
2or example, Map,oint can show average household income demographic data Gwhich is built into
Map,ointI and then show your company sales data for the same regions. This can help you see trends in
how your organiAation sells across demographic groups. You can save these maps, annotate them, and
use them later.
4f your organiAation tracks anything by region, city, etc., take a look at Map,oint. 4t/s also a great
general-purpose mapping application that will let you create maps for your !indows (E devices using
Microsoft ,ocket .treets. 2or more on Map,oint, visit http?@@www.microsoft.com@office@mappoint@.
#reate an O!tloo$ essage fro Excel
The ability to create obFects from other ffice applications is one of the great things about using :;$. 2or
example, you can write a macro that will create an utlook message obFect and attach a shortcut to the
currently open workbook. $ button on the toolbar will perform this same action, which is fine if that/s all
you want to do. ;ut using the sample macro below, you can add other text to the message, pre-address it,
or perform other actions. You can also tie the creation of the message to some other user action. 2or
instance, you could automatically send a message to certain people if the user saves the workbook and if
,age <"
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
the values of certain cells match criteria you setCall without any user interaction. This sample macro will
get you started in the right direction?
Sub :reate.utloo#@ail()
/im olApp As .utloo#.Application
/im ol@ail@essage As .utloo#.@ail)tem

A :reate ne9 instance of .utloo# or open current instance.
Set olApp ! $e9 .utloo#.Application
A :reate ne9 message.
Set ol@ail@essage ! olApp.:reate)tem(ol@ail)tem)
"ith ol@ail@essage
.SubBect ! 7,esting mail b; Automation7
.Cod; ! 7,his message 9as created b; &CA code running .utloo# through Automation.7 D
2 :hr(56)
.Attachments.Add Application.Active"or#boo#.Path 2 7\7 2 D
Application.Active"or#boo#.$ame0 olC;(eference

./ispla;
%nd "ith
Set ol@ail@essage ! $othing
olApp.Euit
Set olApp ! $othing
%nd Sub
Repairing bro$en file type associations
7ow many times has one of your users mysteriously lost his or her file associations, reEuiring you to go to
the 2ile Types tab and re-associate Excel Gor !ord and ,ower,ointI to the .xls and .xlt file typesM
There/s a faster way to fix ffice file type associations, and it takes Fust one Euick step. &sing the
@regserver command line switch will make Excel reregister itself and rewrite all its registry entries,
including its file type associations. You can reset all your users/ file extensions for Excel, !ord,
,ower,oint, and $ccess using this same method.
2rom the command line, type C:\Program Files\Microsoft Office\Office\Excel.exe /regserver. You can
also modify a shortcut to Excel by adding @regserver after the end Euotes in the Target field of the .hortcut
tab on the shortcut/s ,roperties sheet.
Web &!blishing Wi6ard Error "ith Office %000
!hen trying to run the .etup utility after your initial ffice *+++ setup, you may receive the following error?
)nsert /is#
,he file A:rs9pp.dllA on "eb Publishing "iFard dis# cannot be found.
)nsert "eb Publishing "iFard dis# in the selected drive0 and clic# .G.
2urther efforts to run .etup will produce similar errors.
Microsoft has identified the problem as being connected to the installation of some modem hardware.
2ortunately, clicking (ancel when you receive this error message will usually prompt .etup to run
successfully with no harmful effects.
2or more information about all the causal factors, including a complete description of the problematic
modem hardware and possible resolutions, check out Microsoft 1nowledge ;ase article *"'-66?
http?@@support.microsoft.com@support@kb@articles@5*"'@-@66.asp
,age <'
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
Use a!diting to tro!bleshoot
!e/ve all clicked a cell to see the formula, wanting to find out where the result came from, only to find a
formula that went on forever. 4t has everything? nested functions inside of conditionals, pulling data from
cells all over the workbook. 8ust when you think you/ll never figure this monster out, you remember
Excel/s $uditing features.
.elect the cell containing the complex formula and click Tools N $uditing N Trace ,recedents. G4n Excel
L,, choose Tools N 2ormula $uditing N Trace ,recedents.I Excel will draw blue arrows from every cell the
formula references to the cell containing the formula. >ow you can see where that data is coming from.
$uditing also allows you to select a cell containing a value and choose Trace #ependants, which will
draw arrows from the cell to all the cells containing formulas that reference that value.
$nd if you have a cell that shows an error value, you can select it and choose Trace Error. Excel will
show you all the cells that contribute to the error.
Using 9oal 'ee$
You have a worksheet that has the price of a house, closing costs, and interest rate, and it calculates your
monthly payment. 4t works great, but now you want to enter a desirable payment and find the price you
can afford to get that payment.
This is a common situation when dealing with worksheets Galthough usually more complex than a
simple mortgage formulaI, especially when dealing with proFections or forecasts. Doal .eek is Fust what
you need for this situation. 4t allows you to specify a target value for a cell and tell Excel to change the
value of another related cell to obtain this value.
7ighlight the cell you want to change and click Tools N Doal .eek. The cell reference for the selected
cell will appear in the .et (ell field. (hoose a target value and enter it in the To :alue field, then specify
what cell should be changed to meet your target. !hen you click 1, Excel will attempt to meet your
target.
Using shared "or$boo$s
4f you have several users who need to work from the same workbook at the same time, familiariAe
yourself with Excel/s .hared !orkbook feature. This feature can be a lifesaver when workbooks must be
updated by multiple users.
To use this feature, select Tools N .hare !orkbook, and Excel will allow multiple users to edit the
workbook. You can set options that control when changes are updated and how to handle conflicting edits
by different users. You can also choose to save updates when a user clicks .ave, or you can specify a
time interval for Excel to automatically save user updates. 4n the .hare !orkbook dialog box, you can
decide how changes should be logged by the Track (hanges feature, which integrates with workbook
sharing. That way, you can see exactly what changes were made to cells, when sheets were added or
deleted, how conflicting edits were resolved, etc. &sers can also see the names of all the other users who
have the workbook open for editing.
Use the -ediate "indo"
ne of the tools provided by the :;$ Editor is the 4mmediate window. You can use it as a general-
purpose scratch pad while testing your code. 2or instance, you can place ,rint commands at various
places in your code to output variable values or the results of calculations to this window. 2or example?
For :ount ! 5 to 18
/ebug.Print :ount
$ext :ount
This code prints the numbers < through *+ to the 4mmediate window.
,age <)
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
You can use the 4mmediate window to check or change variable values or obFect properties to test the
results on your running code. You can also call other procedures from this window. 2or example?
/ebug.Print A H 51I
multiplies the current value of the variable A by <*) and prints the results in the window.
Activesheet.$ame ! 7$e9 $ame7
changes the name of the active sheet.
The 4mmediate window offers an excellent way to test the outcome of new values or property changes
on your code without inserting the new code into your procedure.
'!ari6e data "ith gro!ping
Drouping in Excel allows you to create outline structures with your data. 0et/s say that you have a column
of numbers with a cell at the bottom that contains their sum. You could Fust leave it at that and have other
worksheet users view the entire column every time they open the workbook. r you could use Drouping
to hide the numbers, showing only the sum but providing the option of expanding the outline to see the
hidden data.
Drouping adds a small column to the left of your data with plus and minus symbols to let users expand
or hide the detailed data. To build this outline, select the columns of data that will be hidden in your outline
and choose #ata N Droup $nd utline N Droup. Excel will add the expand@collapse symbol to the left of
your data. Your users can now choose whether to see the source data for the calculations or Fust the
totals.
You can choose whether the outline should assume the Totals row is above or below the data. You can
also use this feature to summariAe rows in the same way, so an outline expands or collapses across rows
instead of columns.
Ta$e a fe" shortc!ts
!ho doesn/t need to save a little time here and thereM 1eyboard shortcuts can help you do Fust that.
7ere/s a list of shortcuts for Excel that will make life a little easier?
J(trlKJ.hiftK$? &se this combination after typing a function name, and it will automatically enter the
parentheses and the argument names for the function you typed.
J$ltKJ26K? #isplays the Macro dialog box.
J$ltKJ2<<K? pens the :;$ Editor or switches to it if it/s already open.
J(trlK<? #isplays the 2ormat (ells dialog box.
J(trlKJ.hiftKJOK? $pplies the Deneral format.
J(trlKJ.hiftKJWK? 2ormats the current cells as (urrency.
J(trlKJ.hiftKJUK? $pplies the #ate format.
J.hiftKJ2<+K? #isplays the shortcut menu that applies to the selection.
J2-K? Moves to the next pane in a split worksheet.
J.hiftKJ2-K? Moves to the previous pane.
J(trlKJ2-K? Moves to the next workbook window.
J(trlKJ.hiftKJ2-K? Moves back to the last workbook window.
J2"K? pens a dialog box to paste a >amed %ange into a formula.
J(trlKJ2"K? pens the #efine >ame dialog box.
J(trlKJ.hiftKJ2"K? $utomatically creates >amed %anges from the headers for the selected table of
data with row or column headers.
J.hiftKJ2"K? 4nserts an eEual sign GSI and opens the ,aste 2unction dialog box to help you pick a
formula.
J$ltKJSK? 4nserts the $uto.um function.
J(trlKJTK? 4nserts the current date.
,age <-
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.
Essential Excel tips
Analy6ing external data in Excel
Your users might not know that they can use Excel to analyAe data from the various databases in your
organiAation. They can use the powerful analytical tools of Excel on data they previously only viewed or
edited within the database user interface. &sing these features, they can pull data from your customer
database, sales tracking database, product catalog, and 7% systems into various sheets in a workbook
and perform complex pivot table analysis not possible using the separate applications.
This ability is provided by the use of Microsoft 5uery, an ffice application that lives BbehindB Excel. You
can access Microsoft 5uery by clicking #ata N Det External #ata. The 5uery interface is similar to the
#esign view of a Euery in $ccess. ,oint 5uery at a database, and it will allow you to build complex
relational Eueries to pull the necessary data into your worksheet. >ow you can build your pivot tables and
perform your analysis.
Ta$e advantage of the &ersonal /acro Wor$boo$
The ,ersonal Macro !orkbook is the Excel cousin to the >ormal.dot file in !ord. 4t/s a file that opens with
Excel in the background and makes your saved macros available for any open workbook. This workbook
is one of the options available when recording new macros in Excel.
!e recommend saving all macros that will be used across multiple workbooks into the ,ersonal Macro
!orkbook. This will keep things simpler for your users. 4f they try to save a macro into each workbook
where it will be used, they/ll have a tough Fob of updating if the macro reEuires a change. 4f it/s saved in
the ,ersonal Macro !orkbook, it will need to be changed only once. The change will be available across
all workbooks. !hen writing macros in the :;$ Editor, macros should be saved in ,ersonal.xls.
%emember to retain this workbook when doing backups. 4t can be a valuable file once you begin creating
macros that help in your work.
#lear o!t all coents
$s handy as comments can be in annotating the information in a worksheet, your users may sometimes
want to delete them once they/ve served their purpose. The fastest way to handle this task is to click Edit N
Do To N .pecial and then select the (omments option and click 1. &sers can then choose (lear from
the Edit menu and select (omments. Excel will delete all the comments and their text from the current
worksheet.
,age <3
(opyright =*++" (>ET >etworks, 4nc. $ll rights reserved.
To see more downloads and get your free Tech%epublic membership, please visit
http?@@techrepublic.com.com@*++<--*'+-+.html.

You might also like